From 9422974d93743b69303957a879991b042c822416 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 24 Jan 2022 13:13:49 -0700 Subject: [PATCH] cherry-pick(#11596): fix(esm): don't emit module shorthand warning (#11598) Co-authored-by: Pavel Feldman --- packages/playwright-test/src/transform.ts | 3 +-- tests/playwright-test/resolver.spec.ts | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/playwright-test/src/transform.ts b/packages/playwright-test/src/transform.ts index f9d48186e7..056bb5bd2c 100644 --- a/packages/playwright-test/src/transform.ts +++ b/packages/playwright-test/src/transform.ts @@ -89,9 +89,8 @@ export function transformHook(code: string, filename: string, tsconfig: TsConfig relative = relative.replace(/\//g, path.sep); const result = path.resolve(tsconfig.baseUrl || '', relative); for (const extension of extensions) { - // TODO: We can't cover this one with the hash! if (fs.existsSync(result + extension)) - return result; + return result + extension; } } return name; diff --git a/tests/playwright-test/resolver.spec.ts b/tests/playwright-test/resolver.spec.ts index fc09a7ed06..ef2b508070 100644 --- a/tests/playwright-test/resolver.spec.ts +++ b/tests/playwright-test/resolver.spec.ts @@ -135,6 +135,7 @@ test('should respect baseurl w/o paths', async ({ runInlineTest }) => { `, }); + expect(result.output).not.toContain('Could not'); expect(result.passed).toBe(1); expect(result.exitCode).toBe(0); });