Skip to content

Commit

Permalink
test: add test for Node.js ES Modules and CommonJS usage
Browse files Browse the repository at this point in the history
Also remove unused npm script for browser-esmodules
  • Loading branch information
ctavan committed Apr 28, 2020
1 parent 7158302 commit a39089a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ jobs:
if: matrix.node-version == '12.x'
env:
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
- run: npm run test:node
if: matrix.node-version == '12.x' || matrix.node-version == '14.x'
File renamed without changes.
3 changes: 1 addition & 2 deletions examples/node-esmodules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
"name": "uuid-example-node-esmodules",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"test": "node --experimental-modules example.js"
"test": "node --experimental-modules example.mjs"
},
"dependencies": {
"uuid": "file:../../.local"
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,19 @@
"standard-version": "7.1.0"
},
"scripts": {
"examples:browser-webpack:build": "cd examples/browser-webpack && npm install && npm run build",
"examples:browser-rollup:build": "cd examples/browser-rollup && npm install && npm run build",
"examples:browser-esmodules:build": "cd examples/browser-esmodules && npm install && npm run build",
"examples:browser:webpack:build": "cd examples/browser-webpack && npm install && npm run build",
"examples:browser:rollup:build": "cd examples/browser-rollup && npm install && npm run build",
"examples:node:commonjs:test": "cd examples/node-commonjs && npm install && npm test",
"examples:node:esmodules:test": "cd examples/node-esmodules && npm install && npm test",
"lint": "npm run eslint:check && npm run prettier:check",
"eslint:check": "eslint src/ test/ examples/ *.js",
"eslint:fix": "eslint --fix src/ test/ examples/ *.js",
"pretest": "[ -n $CI ] || npm run build",
"test": "BABEL_ENV=commonjs node --throw-deprecation node_modules/.bin/jest test/unit/",
"pretest:browser": "npm run build && npm-run-all --parallel examples:**",
"pretest:browser": "npm run build && npm-run-all --parallel examples:browser:**",
"test:browser": "wdio run ./wdio.conf.js",
"pretest:node": "npm run build",
"test:node": "npm-run-all --parallel examples:node:**",
"prettier:check": "prettier --ignore-path .prettierignore --check '**/*.{js,jsx,json,md}'",
"prettier:fix": "prettier --ignore-path .prettierignore --write '**/*.{js,jsx,json,md}'",
"bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json",
Expand Down

0 comments on commit a39089a

Please sign in to comment.