From a70db55b2efbbb91db318f760d9a0d498e7faaf7 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 5 Oct 2023 16:41:26 +0200 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fredrik Adelöw Signed-off-by: Patrik Oldsberg --- packages/backend-common/src/testUtils.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/backend-common/src/testUtils.ts b/packages/backend-common/src/testUtils.ts index 8be6010010..9616ab1701 100644 --- a/packages/backend-common/src/testUtils.ts +++ b/packages/backend-common/src/testUtils.ts @@ -19,7 +19,7 @@ import { posix as posixPath, resolve as resolvePath } from 'path'; /** @public */ export interface PackagePathResolutionOverride { - /** Restored the normal behavior of resolvePackagePath */ + /** Restores the normal behavior of resolvePackagePath */ restore(): void; } @@ -36,7 +36,7 @@ export interface OverridePackagePathResolutionOptions { * that is being resolved within the package. * * For example, code calling `resolvePackagePath('x', 'foo', 'bar')` would match only the following - * configuration: `overridePackagePathResolution({ packageNAme: 'x', paths: { 'foo/bar': baz } })` + * configuration: `overridePackagePathResolution({ packageName: 'x', paths: { 'foo/bar': baz } })` */ paths?: { [path in string]: string | (() => string) }; } @@ -52,7 +52,9 @@ export function overridePackagePathResolution( const name = options.packageName; if (packagePathMocks.has(name)) { - throw new Error(`Duplicate package path mock for package '${name}'`); + throw new Error( + `Tried to override resolution for '${name}' more than once for package '${name}'`, + ); } packagePathMocks.set(name, paths => {