diff --git a/README.md b/README.md index 400418d..5f40e30 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Open a recording and click export to use the Testing Library script option. * @jest-environment-options { "url": "https://example.com/" } */ const { screen, waitFor } = require("@testing-library/dom") -const userEvent = require("@testing-library/user-event") +const { default: userEvent } = require("@testing-library/user-event") require("@testing-library/jest-dom") test("Example", async () => { diff --git a/src/fixtures/example.test.js b/src/fixtures/example.test.js index c6b1ca1..f4de4ea 100644 --- a/src/fixtures/example.test.js +++ b/src/fixtures/example.test.js @@ -3,7 +3,7 @@ * @jest-environment-options { "url": "https://example.com/" } */ const { screen, waitFor } = require("@testing-library/dom") -const userEvent = require("@testing-library/user-event") +const { default: userEvent } = require("@testing-library/user-event") require("@testing-library/jest-dom") test("Example", async () => { diff --git a/src/index.ts b/src/index.ts index 40db359..5db1c81 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,7 +28,9 @@ export class Extension implements StringifyExtension { out.appendLine( 'const { screen, waitFor } = require("@testing-library/dom")', ) - out.appendLine('const userEvent = require("@testing-library/user-event")') + out.appendLine( + 'const { default: userEvent } = require("@testing-library/user-event")', + ) out.appendLine('require("@testing-library/jest-dom")') out.appendLine("")