Skip to content

Commit

Permalink
Upgrade Jest and drop Node 4 (#48)
Browse files Browse the repository at this point in the history
* Upgrade Jest

* Add jest-watch-typeahead and update snapshots

* Update jest config

* Drop Node 4

* Add Node 10 to Travis config
  • Loading branch information
rogeliog committed Sep 26, 2018
1 parent c811667 commit db664b6
Show file tree
Hide file tree
Showing 8 changed files with 939 additions and 351 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "8"
- "7"
- "6"
- "4"
- '10'
- '8'
- '7'
- '6'
2 changes: 1 addition & 1 deletion integrationTests/__snapshots__/failing.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

exports[`Works when it has failing tests 1`] = `
"FAIL integrationTests/__fixtures__/failing/__eslint__/file.js
✕ ESLint
/mocked-path-to-jest-runner-mocha/integrationTests/__fixtures__/failing/__eslint__/file.js
4:3 error 'hello' is not defined no-undef
5:3 error 'bye' is not defined no-undef
✖ 2 problems (2 errors, 0 warnings)
✕ ESLint
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Expand Down
2 changes: 1 addition & 1 deletion integrationTests/__snapshots__/format.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

exports[`Applies custom formatter 1`] = `
"FAIL integrationTests/__fixtures__/format/__eslint__/file.js
✕ ESLint
at mocked-stack-trace 2 |
3 | if (a === 2) {
> 4 | hello();
Expand All @@ -16,7 +17,6 @@ mocked-stack-trace 3 | if (a === 2) {
6 | }
7 |
2 errors found.
✕ ESLint
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Expand Down
2 changes: 1 addition & 1 deletion integrationTests/__snapshots__/max-warnings.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

exports[`Fails if more than max warnings 1`] = `
"FAIL integrationTests/__fixtures__/max-warnings/__eslint__/file.js
✕ ESLint
/mocked-path-to-jest-runner-mocha/integrationTests/__fixtures__/max-warnings/__eslint__/file.js
3:1 warning Unexpected console statement no-console
4:1 warning Unexpected console statement no-console
5:1 warning Unexpected console statement no-console
✖ 3 problems (0 errors, 3 warnings)
ESLint found too many warnings (maximum: 2).
✕ ESLint
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Expand Down
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
testPathIgnorePatterns: ['/examples/', '/node_modules/', '/__eslint__/'],
testMatch: [
'<rootDir>/src/**/__tests__/**/*.js',
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@
},
"devDependencies": {
"babel-cli": "6.26.0",
"babel-jest": "21.0.0",
"babel-jest": "23.6.0",
"babel-preset-env": "1.6.0",
"eslint-config-airbnb-base": "11.3.2",
"eslint-config-prettier": "2.3.0",
"eslint-plugin-import": "2.7.0",
"eslint-plugin-jest": "20.0.3",
"eslint-plugin-prettier": "2.2.0",
"execa": "0.8.0",
"jest": "21.0.1",
"jest": "23.6.0",
"jest-watch-typeahead": "^0.2.0",
"prettier": "1.5.3"
}
}
4 changes: 1 addition & 3 deletions src/utils/__tests__/normalizeConfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ it('normalizes parser', () => {
});

it('normalizes parserOptions', () => {
expect(normalizeCLIOptions({})).not.toMatchObject({
parserOptions: {},
});
expect(normalizeCLIOptions({}).parseOptions).toBeUndefined();

expect(
normalizeCLIOptions({ parserOptions: { ecmaVersion: 2015 } }),
Expand Down
Loading

0 comments on commit db664b6

Please sign in to comment.