Skip to content

Commit

Permalink
fix tests to match two different assertion error style in node 6 and …
Browse files Browse the repository at this point in the history
…above
  • Loading branch information
ranyitz committed Feb 17, 2018
1 parent c4240b7 commit ef53dc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions packages/jest-util/src/__tests__/buffered_console.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ describe('CustomConsole', () => {
test('log the assertion error when the assertion is falsy', () => {
_console.assert(false);

expect(stdout()).toEqual('AssertionError [ERR_ASSERTION]: false == true');
expect(stdout()).toMatch('AssertionError');
expect(stdout()).toMatch('false == true');
});

test('log the assertion error when the assertion is falsy with another message argument', () => {
_console.assert(false, 'ok');

expect(stdout()).toEqual('AssertionError [ERR_ASSERTION]: ok');
expect(stdout()).toMatch('AssertionError');
expect(stdout()).toMatch('ok');
});
});

Expand Down
8 changes: 4 additions & 4 deletions packages/jest-util/src/__tests__/console.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ describe('CustomConsole', () => {
test('log the assertion error when the assertion is falsy', () => {
_console.assert(false);

expect(_stdout).toEqual(
'AssertionError [ERR_ASSERTION]: false == true\n',
);
expect(_stdout).toMatch('AssertionError');
expect(_stdout).toMatch('false == true');
});

test('log the assertion error when the assertion is falsy with another message argument', () => {
_console.assert(false, 'ok');

expect(_stdout).toEqual('AssertionError [ERR_ASSERTION]: ok\n');
expect(_stdout).toMatch('AssertionError');
expect(_stdout).toMatch('ok');
});
});

Expand Down

0 comments on commit ef53dc6

Please sign in to comment.