Skip to content

Commit

Permalink
Revert mocha setup. Only run browser entry point if in browser.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaovieira committed Apr 9, 2018
1 parent 89986db commit 0a07a3e
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = (config) => {

frameworks: ['mocha', 'sinon', 'chai'],

files: ['test/tests.webpack.js'],
files: ['test/browser-main.js'],

webpack: {
externals: {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
"build:css": "node scripts/buildCSS.js",
"clean": "rimraf lib esm",
"precover": "rimraf coverage && npm run react",
"cover": "cross-env NODE_ENV=test node --max-old-space-size=2048 $(which nyc) mocha",
"cover": "cross-env NODE_ENV=test node --max-old-space-size=2048 $(which nyc) npm run mocha test",
"lint": "eslint --ext .js,.jsx src test",
"mocha": "mocha ./test/_helpers",
"storybook:uninstall": "npm uninstall --no-save @storybook/react && rimraf node_modules/@storybook node_modules/react-modal node_modules/react-dom-factories",
"react": "enzyme-adapter-react-install 16",
"pretest": "npm run --silent lint",
"pretests-only": "npm run react",
"tests-only": "mocha",
"tests-only": "npm run mocha --silent test",
"pretests-karma": "npm run react",
"tests-karma": "karma start",
"test": "npm run tests-only",
Expand Down
6 changes: 0 additions & 6 deletions test/_helpers/ignoreSVGStrings.jsx

This file was deleted.

6 changes: 6 additions & 0 deletions test/browser-main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const requireAll = requireContext => requireContext.keys().forEach(requireContext);

if (typeof window !== 'undefined') {
requireAll(require.context('./_helpers', true, /.jsx?$/));
requireAll(require.context('.', true, /.jsx?$/));
}
1 change: 0 additions & 1 deletion test/mocha.opts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
--compilers js:babel-register,jsx:babel-register
--require airbnb-js-shims
--recursive
test/_helpers test/**/*_spec*
4 changes: 0 additions & 4 deletions test/tests.webpack.js

This file was deleted.

File renamed without changes.
File renamed without changes.

0 comments on commit 0a07a3e

Please sign in to comment.