Skip to content

Commit

Permalink
Bundle the tests for execution in karma.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjeffburke committed Dec 23, 2019
1 parent d42a881 commit a993f95
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = function(config) {
'./node_modules/unexpected-snapshot/unexpected-snapshot-browser.js',
'./unexpected-dom.js',
'./test/common/browser.js',
'./build/test/**/*.spec.js'
'./build/tests.js'
],

client: {
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
],
"scripts": {
"bundle": "rollup -c",
"bundle-tests": "rollup -c rollup.tests.js --format umd > build/tests.js",
"build": "babel --out-dir lib --quiet src",
"build-tests": "babel --out-dir build/test --ignore test/common --quiet test",
"changelog": "offline-github-changelog > CHANGELOG.md",
"lint": "eslint . && prettier --check '**/*.js'",
"test": "npm run test-node && npm run test-docs",
"test-browser": "npm run build && npm run bundle && npm run build-tests && karma start --single-run --browsers ${BROWSER:-ChromeHeadless}",
"test-browser": "npm run build && npm run bundle && npm run build-tests && npm run bundle-tests && karma start --single-run --browsers ${BROWSER:-ChromeHeadless}",
"test-docs": "mocha `find documentation -name '*.md'`",
"test-node": "mocha",
"test-headless": "npm run test-browser",
Expand Down Expand Up @@ -45,6 +46,7 @@
},
"homepage": "https://github.com/unexpectedjs/unexpected-dom",
"devDependencies": {
"@rollup/plugin-multi-entry": "^3.0.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
Expand Down
7 changes: 7 additions & 0 deletions rollup.tests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
input: 'build/test/**/*.spec.js',
output: {
strict: false
},
plugins: require('@rollup/plugin-multi-entry')({ exports: false })
};

0 comments on commit a993f95

Please sign in to comment.