Skip to content

Commit

Permalink
Don't use build output for /esm/* exports
Browse files Browse the repository at this point in the history
When using the build output for these exports the tests which import
these modules as part of the test case fail.

This has two reasons:
1. In CI/CD npm run build is not run before the tests so the
   modules fail to be imported. This could be solved by first building
   the package.
2. In the tests the modules are imported via ES Modules syntax and the
   import function and the result is compared for referential equality.
   When the built file is imported through the import function and
   it's compared to the source file the reference is always
   not the same.

When this part of the code is converted to TypeScript these issues must
be addressed.
  • Loading branch information
emilpaw committed Sep 16, 2022
1 parent 9da2a7c commit 5263183
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
"./lib/": "./dist/lib/",
"./utils/": "./dist/utils/",
"./package.json": "./package.json",
"./esm/cli": "./dist/cli/index.mjs",
"./esm/generators/*": "./dist/generators/*/esm.mjs",
"./esm/generators": "./dist/lib/constants/generators.mjs",
"./esm/priorities": "./dist/lib/constants/priorities.mjs",
"./esm/support": "./dist/lib/support/index.cjs"
"./esm/cli": "./cli/index.mjs",
"./esm/generators/*": "./generators/*/esm.mjs",
"./esm/generators": "./lib/constants/generators.mjs",
"./esm/priorities": "./lib/constants/priorities.mjs",
"./esm/support": "./lib/support/index.cjs"
},
"main": "dist/lib/index.js",
"bin": {
Expand Down Expand Up @@ -78,6 +78,7 @@
"prettier:format": "prettier --write \"{,**/}*.{js,ts,cjs,mjs,json,md,yml,java}\"",
"pretest": "npm run lint",
"test": "mocha test generators --no-insight --forbid-only --parallel --max-old-space-size=4096",
"test-single": "mocha test test/cli/cli.spec.js",
"update-snapshot": "mocha --no-insight --no-parallel --updateSnapshot --",
"update-snapshots": "npm run update-snapshot -- test generators"
},
Expand Down

0 comments on commit 5263183

Please sign in to comment.