Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build on node 9 on Circle #4851

Merged
merged 4 commits into from
Dec 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of this, but can live with it. Worth to refactor this test one day though.

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!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gah, these trailing spaces gets killed every time I rebase, and I keep forgetting to add them back in :P

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();
});