diff --git a/build.js b/build.js index 23f0d1df..cbd2322e 100644 --- a/build.js +++ b/build.js @@ -55,6 +55,6 @@ makeBundle( }) .join("\n"); - fs.writeFileSync("pkg/fake-timers-esm.js", source); + fs.writeFileSync("pkg/fake-timers-esm.mjs", source); } ); diff --git a/package.json b/package.json index 83c7938b..04102e06 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "test-check-coverage": "npm run test-coverage && nyc check-coverage", "test-cloud": "mochify --wd --no-detect-globals --timeout=10000", "test-coverage": "nyc --all --reporter text --reporter html --reporter lcovonly npm run test-node", - "test-esm": "node -r esm test-esm/fake-timers-esm-test.js", + "test-esm": "node test-esm/fake-timers-esm-test.mjs", "test": "npm run lint && npm run test-node && npm run test-headless && npm run test-esm", "bundle": "node ./build.js", "prepublishOnly": "npm run bundle", @@ -86,7 +86,7 @@ } ] }, - "module": "./pkg/fake-timers-esm.js", + "module": "./pkg/fake-timers-esm.mjs", "cdn": "./pkg/fake-timers.js", "jsdelivr": "./pkg/fake-timers.js", "main": "./src/fake-timers-src.js", @@ -105,7 +105,7 @@ "statements": 92, "exclude": [ "**/*-test.js", - "**/*-test-esm.js", + "test-esm/**", "build.js", "coverage/**", "pkg/**" diff --git a/test-esm/fake-timers-esm-test.js b/test-esm/fake-timers-esm-test.mjs similarity index 89% rename from test-esm/fake-timers-esm-test.js rename to test-esm/fake-timers-esm-test.mjs index a6dd1181..51bb492e 100644 --- a/test-esm/fake-timers-esm-test.js +++ b/test-esm/fake-timers-esm-test.mjs @@ -1,5 +1,5 @@ /* eslint-disable no-console */ -import * as timers from "../pkg/fake-timers-esm.js"; +import * as timers from "../pkg/fake-timers-esm.mjs"; const expectedExports = ["timers", "createClock", "install", "withGlobal"];