Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix tests to match two different assertion error style in node 6 and …
…above
  • Loading branch information
ranyitz committed Feb 19, 2018
commit 248a0fa0d384bb78da2b1fafdda2e092222b0d1d
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