Skip to content

Commit

Permalink
Build on node 9 on Circle (#4851)
Browse files Browse the repository at this point in the history
* Build on node 9 on Circle

* Actually trigger node 9 buid as well

* Run full ci on node 8 instead of node 6

* Fix test for node 9
  • Loading branch information
SimenB authored and cpojer committed Dec 11, 2017
1 parent 25ed471 commit 78741aa
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
16 changes: 14 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ jobs:
- save-cache: *save-cache
- run: yarn run test-ci-es5-build-in-browser

test-node-9:
working_directory: ~/jest
docker:
- image: circleci/node:9
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress
- save-cache: *save-cache
- run: yarn run test-ci-partial

test-node-8:
working_directory: ~/jest
docker:
Expand All @@ -65,7 +76,7 @@ jobs:
- restore-cache: *restore-cache
- run: yarn --no-progress
- save-cache: *save-cache
- run: yarn run test-ci-partial
- run: yarn run test-ci

test-node-6:
working_directory: ~/jest
Expand All @@ -76,7 +87,7 @@ jobs:
- restore-cache: *restore-cache
- *yarn-install
- save-cache: *save-cache
- run: yarn run test-ci
- run: yarn run test-ci-partial

test-and-deploy-website:
working_directory: ~/jest
Expand All @@ -98,5 +109,6 @@ workflows:
jobs:
- test-node-8
- test-node-6
- test-node-9
- test-browser
- test-and-deploy-website
34 changes: 33 additions & 1 deletion integration_tests/__tests__/failures.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,37 @@ test('not throwing Error objects', () => {

test('works with node assert', () => {
const {stderr} = runJest(dir, ['node_assertion_error.test.js']);
expect(normalizeDots(extractSummary(stderr).rest)).toMatchSnapshot();
let summary = normalizeDots(extractSummary(stderr).rest);

// Node 9 started to include the error for `doesNotThrow`
// https://github.com/nodejs/node/pull/12167
if (Number(process.versions.node.split('.')[0]) >= 9) {
expect(summary).toContain(`
assert.doesNotThrow(function)
Expected the function not to throw an error.
Instead, it threw:
[Error: err!]
Message:
Got unwanted exception.
err!
err!
at __tests__/node_assertion_error.test.js:71:10
`);

summary = summary.replace(
`Message:
Got unwanted exception.
err!
err!
`,
`Message:
Got unwanted exception.
`,
);
}

expect(summary).toMatchSnapshot();
});

0 comments on commit 78741aa

Please sign in to comment.