npm ijest modOutput:
Ran all test suites matching "mod".
console.log mod.js:7
foo bar
jest mod --coverageOutput:
Ran all test suites matching "mod".
console.log mod.js:7
bar
| { | |
| "presets": [ | |
| "es2015", | |
| "stage-0" | |
| ] | |
| } | |
| export const foo = () => {} | |
| const bar = () => {} | |
| export { bar } | |
| console.log(foo.name, bar.name) // Expected behavior: foo bar |
| import './mod' | |
| test('dummy empty test', () => {}) |
| { | |
| "name": "export-code-sample", | |
| "version": "0.0.1", | |
| "description": "", | |
| "main": "index.js", | |
| "scripts": { | |
| "test": "echo \"Error: no test specified\" && exit 1" | |
| }, | |
| "author": "DKWings", | |
| "license": "ISC", | |
| "devDependencies": { | |
| "babel-core": "^6.25.0", | |
| "babel-preset-es2015": "^6.24.1", | |
| "babel-preset-stage-0": "^6.24.1", | |
| "jest": "^20.0.4" | |
| } | |
| } |