Skip to content

Commit

Permalink
Merge b1fe2d8 into f91e500
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewiggins committed Nov 6, 2019
2 parents f91e500 + b1fe2d8 commit ab49044
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 59 deletions.
25 changes: 0 additions & 25 deletions .babelrc

This file was deleted.

24 changes: 24 additions & 0 deletions babel.config.js
@@ -0,0 +1,24 @@
module.exports = function(api) {
api.cache(true);

return {
presets: [
[
'@babel/preset-env',
{
loose: true,
exclude: ['@babel/plugin-transform-typeof-symbol'],
targets: {
browsers: ['last 2 versions', 'IE >= 9']
}
}
]
],
plugins: [
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-transform-react-jsx',
'babel-plugin-transform-async-to-promises'
],
ignore: ['./dist']
};
};
22 changes: 1 addition & 21 deletions karma.conf.js
Expand Up @@ -140,28 +140,8 @@ module.exports = function(config) {
exclude: /node_modules/,
loader: 'babel-loader',
options: {
// comments: false,
// compact: true,
plugins: coverage
? [
[
'istanbul',
{
exclude: [
// Default config
'coverage/**',
'dist/**',
'test/**',
'test{,-*}.js',
'**/*.test.js',
'**/__tests__/**',
'**/node_modules/**',
// Our custom extension
'{debug,hooks,compat,test-utils}/test/**/*'
]
}
]
]
? [['istanbul', { include: '**/src/**/*.js' }]]
: []
}
}
Expand Down
21 changes: 10 additions & 11 deletions package.json
Expand Up @@ -23,9 +23,9 @@
"dev:compat": "microbundle watch --raw --format cjs --cwd compat --globals 'preact/hooks=preactHooks'",
"test": "npm-run-all lint build --parallel test:mocha test:karma test:ts",
"test:ts": "run-p test:ts:*",
"test:ts:core": "tsc -p test/ts/ && mocha --require babel-register test/ts/**/*-test.js",
"test:ts:core": "tsc -p test/ts/ && mocha --require \"@babel/register\" test/ts/**/*-test.js",
"test:ts:compat": "tsc -p compat/test/ts/",
"test:mocha": "mocha --recursive --require babel-register test/shared test/node",
"test:mocha": "mocha --recursive --require \"@babel/register\" test/shared test/node",
"test:karma": "cross-env COVERAGE=true karma start karma.conf.js --single-run",
"test:mocha:watch": "npm run test:mocha -- --watch",
"test:karma:watch": "karma start karma.conf.js --no-single-run",
Expand Down Expand Up @@ -136,17 +136,17 @@
},
"homepage": "https://github.com/preactjs/preact",
"devDependencies": {
"@babel/core": "^7.7.0",
"@babel/plugin-proposal-object-rest-spread": "^7.6.2",
"@babel/plugin-transform-react-jsx": "^7.7.0",
"@babel/preset-env": "^7.7.1",
"@babel/register": "^7.7.0",
"@types/chai": "^4.1.2",
"@types/mocha": "^5.0.0",
"@types/node": "^10.5.2",
"babel-cli": "6.26.0",
"babel-core": "6.26.3",
"babel-loader": "7.1.5",
"babel-plugin-istanbul": "5.0.1",
"babel-plugin-transform-async-to-promises": "^0.8.14",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-env": "^1.6.1",
"babel-loader": "^8.0.6",
"babel-plugin-istanbul": "^5.2.0",
"babel-plugin-transform-async-to-promises": "^0.8.15",
"benchmark": "^2.1.4",
"chai": "^4.1.2",
"coveralls": "^3.0.0",
Expand All @@ -158,7 +158,6 @@
"eslint-plugin-react": "7.12.4",
"husky": "^3.0.9",
"karma": "^3.0.0",
"karma-babel-preprocessor": "^7.0.0",
"karma-chai-sinon": "^0.1.5",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.2",
Expand Down
5 changes: 3 additions & 2 deletions test/browser/lifecycles/getDerivedStateFromError.test.js
Expand Up @@ -52,8 +52,8 @@ describe('Lifecycle methods', () => {
}
}

spyAll(Receiver.prototype);
spyAll(Receiver);
spyAll(Receiver.prototype);

function throwExpectedError() {
throw (expectedError = new Error('Error!'));
Expand All @@ -73,8 +73,9 @@ describe('Lifecycle methods', () => {

expectedError = undefined;
receiver = undefined;
resetAllSpies(Receiver.prototype);

resetAllSpies(Receiver);
resetAllSpies(Receiver.prototype);
});

afterEach(() => {
Expand Down

0 comments on commit ab49044

Please sign in to comment.