Open acamposruiz opened 7 years ago
getMockImplementation
✓ should mock calls to a mock function (24ms)
mockImplementationOnce
✓ should mock single call to a mock function (26ms)
✓ should fallback to default mock function when no specific mock is available (25ms)
spyOn
✓ should work (30ms)
✓ should throw on invalid input (25ms)
✓ supports restoring all spies (25ms)
stub()
✕ encountered a declaration exception (27ms)
FAIL packages/jest-mock/src/tests/jest_mock.test.js ● moduleMocker › stub() › encountered a declaration exception
expect(received).toBe(expected)
Expected value to be (using ===):
false
Received:
true
at Object.it (packages/jest-mock/src/__tests__/jest_mock.test.js:539:20)
✓ should work (30ms)
✓ should throw on invalid input (25ms)
✓ supports restoring all spies (25ms)
stub()
✕ encountered a declaration exception (27ms)
FAIL packages/jest-mock/src/tests/jest_mock.test.js ● moduleMocker › stub() › encountered a declaration exception
expect(received).toBe(expected)
Expected value to be (using ===):
false
Received:
true
at Object.it (packages/jest-mock/src/__tests__/jest_mock.test.js:539:20)
Test Suites: 1 failed, 1 total Tests: 1 failed, 37 passed, 38 total Snapshots: 0 total
✓ should work (30ms)
✓ should throw on invalid input (25ms)
✓ supports restoring all spies (25ms)
stub()
✕ encountered a declaration exception (27ms)
FAIL packages/jest-mock/src/tests/jest_mock.test.js ● moduleMocker › stub() › encountered a declaration exception
expect(received).toBe(expected)
Expected value to be (using ===):
false
Received:
true
at Object.it (packages/jest-mock/src/__tests__/jest_mock.test.js:539:20)
Test Suites: 1 failed, 1 total Tests: 1 failed, 37 passed, 38 total Snapshots: 0 total
✓ should work (30ms)
✓ should throw on invalid input (25ms)
✓ supports restoring all spies (25ms)
stub()
✕ encountered a declaration exception (27ms)
FAIL packages/jest-mock/src/tests/jest_mock.test.js ● moduleMocker › stub() › encountered a declaration exception
expect(received).toBe(expected)
Expected value to be (using ===):
false
Received:
true
at Object.it (packages/jest-mock/src/__tests__/jest_mock.test.js:539:20)
Test Suites: 1 failed, 1 total Tests: 1 failed, 37 passed, 38 total Snapshots: 0 total
✓ should work (30ms)
✓ should throw on invalid input (25ms)
✓ supports restoring all spies (25ms)
stub()
✕ encountered a declaration exception (27ms)
FAIL packages/jest-mock/src/tests/jest_mock.test.js ● moduleMocker › stub() › encountered a declaration exception
expect(received).toBe(expected)
Expected value to be (using ===):
false
Received:
true
at Object.it (packages/jest-mock/src/__tests__/jest_mock.test.js:539:20)
Test Suites: 1 failed, 1 total Tests: 1 failed, 37 passed, 38 total Snapshots: 0 total
Summary
This is a fix for this issue
When running a single test that has many test cases the error messages are printed before the list of failing/passing tests which makes us to scroll up every time just to see the error message.
This Pull Request change the behavior of print error messages to put them after the list of tests
So the behavior is going to switch from the actual:
to this:
In order to keep the messages consistent, Both the FAIL and PASS messages will be printed after the list of failing/passing tests.
So this:
will also switch to:
Test plan