From 490ae796f360ec4785546e31751f9437d948ce66 Mon Sep 17 00:00:00 2001 From: Eduardo Vargas Torres Date: Mon, 21 Nov 2022 17:31:37 -0600 Subject: [PATCH] docs (test-typescript-js.md): clarify TS ESM config (#18971) Signed-off-by: Eduardo Vargas Torres --- docs/src/test-typescript-js.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/test-typescript-js.md b/docs/src/test-typescript-js.md index 7d29694d5e..8ed0ad13c1 100644 --- a/docs/src/test-typescript-js.md +++ b/docs/src/test-typescript-js.md @@ -34,7 +34,7 @@ test('example', async ({ page }) => { You can opt into using [ECMAScript modules](https://nodejs.org/api/esm.html) by setting `type: "module"` in your `package.json` file. Playwright Test will switch to the ESM mode once it reads the `playwright.config.ts` file, so make sure you have one. -Playwright Test follows the [experimental support for ESM in TypeScript](https://www.typescriptlang.org/docs/handbook/esm-node.html) and, according to the specification, **requires an extension** when importing from a module, either `'.js'` or `'.ts'`. +Playwright Test follows the [experimental support for ESM in TypeScript](https://www.typescriptlang.org/docs/handbook/esm-node.html) and, according to the specification, **requires a file extension** when importing from a module, either `'.js'` or `'.ts'`. First, enable modules in your `package.json`: