Created
June 26, 2015 04:06
-
-
Save why-jay/aefc5405f27e20b08ebc to your computer and use it in GitHub Desktop.
Why does foo-test fail?
This file contains hidden or 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
Using Jest CLI v0.4.13 | |
FAIL __tests__/foo-test.js (0.896s) | |
● foo() › it should throw | |
- Expected function to throw an exception. |
This file contains hidden or 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
// __tests__/foo-test.js | |
import foo from '../src/foo.js'; | |
describe('foo()', () => { | |
it('should throw', () => { | |
expect(() => { | |
foo(); | |
}).toThrow(); | |
}); | |
}); |
This file contains hidden or 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
// src/foo.js | |
export default function foo() { | |
throw new Error(); | |
} |
This file contains hidden or 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
{ | |
"devDependencies": { | |
"babel-jest": "*", | |
"jest-cli": "*" | |
}, | |
"scripts": { | |
"test": "jest" | |
}, | |
"jest": { | |
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest", | |
"testFileExtensions": ["es6", "js"], | |
"moduleFileExtensions": ["js", "json", "es6"], | |
"unmockedModulePathPatterns": ["lodash"] | |
} | |
} |
This file contains hidden or 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
node v0.12.2 | |
npm v2.11.2 | |
babel-jest v5.3.0 | |
jest-cli v0.4.13 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Disregard, see https://github.com/babel/babel-jest/issues/16