Skip to content

Instantly share code, notes, and snippets.

@dkwingsmt
Last active July 12, 2017 22:10
Show Gist options
  • Select an option

  • Save dkwingsmt/c2ee75b0c6c141594eafc38e984ffa28 to your computer and use it in GitHub Desktop.

Select an option

Save dkwingsmt/c2ee75b0c6c141594eafc38e984ffa28 to your computer and use it in GitHub Desktop.
{
"presets": [
"es2015",
"stage-0"
]
}

Install

npm i

Run

Normal behavior

jest mod

Output:

Ran all test suites matching "mod".
  console.log mod.js:7
    foo bar

Abnormal behavior when "--coverage" is on

jest mod --coverage

Output:

Ran all test suites matching "mod".
  console.log mod.js:7
    bar
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"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment