Skip to content

Commit d06b79c

Browse files
committed
test: add test for Node.js ES Modules and CommonJS usage
Also remove unused npm script for browser-esmodules
1 parent 2952b66 commit d06b79c

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ jobs:
3838
if: matrix.node-version == '12.x'
3939
env:
4040
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
41+
- run: npm run test:node
42+
if: matrix.node-version == '12.x' || matrix.node-version == '14.x'

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,19 @@
7272
"standard-version": "7.1.0"
7373
},
7474
"scripts": {
75-
"examples:browser-webpack:build": "cd examples/browser-webpack && npm install && npm run build",
76-
"examples:browser-rollup:build": "cd examples/browser-rollup && npm install && npm run build",
77-
"examples:browser-esmodules:build": "cd examples/browser-esmodules && npm install && npm run build",
75+
"examples:browser:webpack:build": "cd examples/browser-webpack && npm install && npm run build",
76+
"examples:browser:rollup:build": "cd examples/browser-rollup && npm install && npm run build",
77+
"examples:node:commonjs:test": "cd examples/node-commonjs && npm install && npm test",
78+
"examples:node:esmodules:test": "cd examples/node-esmodules && npm install && npm test",
7879
"lint": "npm run eslint:check && npm run prettier:check",
7980
"eslint:check": "eslint src/ test/ examples/ *.js",
8081
"eslint:fix": "eslint --fix src/ test/ examples/ *.js",
8182
"pretest": "[ -n $CI ] || npm run build",
8283
"test": "BABEL_ENV=commonjs node --throw-deprecation node_modules/.bin/jest test/unit/",
83-
"pretest:browser": "npm run build && npm-run-all --parallel examples:**",
84+
"pretest:browser": "npm run build && npm-run-all --parallel examples:browser:**",
8485
"test:browser": "wdio run ./wdio.conf.js",
86+
"pretest:node": "npm run build",
87+
"test:node": "npm-run-all --parallel examples:node:**",
8588
"prettier:check": "prettier --ignore-path .prettierignore --check '**/*.{js,jsx,json,md}'",
8689
"prettier:fix": "prettier --ignore-path .prettierignore --write '**/*.{js,jsx,json,md}'",
8790
"bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json",

0 commit comments

Comments
 (0)