-
-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: test imports with npm package contents (#425)
* test: test imports with npm package contents Especially for publishing CommonJS/ESM/Browser dual packages a lot can go wrong in the actual build and release step, see: https://medium.com/javascript-in-plain-english/is-promise-post-mortem-cab807f18dcc In order to catch regressions with respect to the supported ways of importing this library it makes sense to test this using `npm pack`. Fixes #424 * chore: ignore *.tgz files * build: run build as prepack command This simplifies using npm pack in CI tests.
- Loading branch information
Showing
4 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ dist/ | |
# Browserstack | ||
browserstack.err | ||
local.log | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash -eu | ||
|
||
# cd to the root dir | ||
ROOT="$(pwd)/$(dirname "$0")/.." | ||
cd "$ROOT" || exit 1 | ||
|
||
npm pack | ||
|
||
mkdir -p ../test-pack | ||
|
||
cp examples/node-commonjs/example.js ../test-pack/commonjs.js | ||
cp examples/node-esmodules/example.mjs ../test-pack/esmodules.mjs | ||
|
||
cd ../test-pack | ||
|
||
npm init -y | ||
|
||
npm install ../uuid/uuid-*.tgz | ||
|
||
node commonjs.js | ||
node esmodules.mjs |