Last active
August 29, 2015 14:13
-
-
Save randymorris/439a85bccc856ca4e8c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Example', function () { | |
it('should fail when extra undefined keys are passed', function() { | |
var test = jest.genMockFunction(); | |
test({a: 1, b: undefined}); | |
expect(test).toBeCalledWith({a: 1}); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ jest | |
Using Jest CLI v0.2.1 | |
PASS __tests__/example-test.js (0.018s) | |
1 test passed (1 total) | |
Run time: 0.417s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ jest | |
Using Jest CLI v0.2.1 | |
FAIL __tests__/example-test.js (0.03s) | |
● Example › it should fail when extra undefined keys are passed | |
- Expected: { | |
| 0: { | |
| | a: 1, | |
| | b: undefined | |
| } | |
} toEqual: { | |
| 0: { | |
| | a: 1 | |
| } | |
} | |
at addMatchers.toBeCalledWith (/usr/lib/node_modules/jest-cli/src/jasmineTestRunner/jasmineTestRunner.js:217:18) | |
at Spec.<anonymous> (/home/user/tmp/test/__tests__/example-test.js:5:18) | |
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15) | |
1 test failed, 0 tests passed (1 total) | |
Run time: 0.424s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment