npm.io
0.0.1 • Published 11 years ago

jestification

Licence
—
Version
0.0.1
Deps
6
Vulns
2
Weekly
0

jestification

Preprocessor for Jest

Installation

  1. Install jestification and tsd
npm install --save-dev jestification tsd
  1. Install the typings for jest
./node_modules/.bin/tsd install --save jest
  1. Add the following jest configuration to your package.json
"jest": {
  "collectCoverage": true,
  "scriptPreprocessor": "<rootDir>/node_modules/jestification/preprocessor.js",
  "testDirectoryName": "tests",
  "testFileExtensions": [
    "js",
    "jsx",
    "ts",
    "tsx"
  ],
  "unmockedModulePathPatterns": [
    "<rootDir>/node_modules/react",
    "<rootDir>/node_modules/react-dom",
    "<rootDir>/node_modules/react-addons-test-utils",
    "<rootDir>/node_modules/fbjs"
  ]
}
  1. Make sure your scripts in package.json include
"scripts": {
  "postinstall": "tsd install",
  "test": "jest"
}

Usage

Running tests is as simple as running the following command

npm test