0.0.1 • Published 9 years ago

jestification v0.0.1

Weekly downloads
3
License
-
Repository
-
Last release
9 years ago

jestification

Preprocessor for Jest

Installation

  1. Install jestification and tsd

    npm install --save-dev jestification tsd
  2. Install the typings for jest

    ./node_modules/.bin/tsd install --save jest
  3. 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"
      ]
    }
  4. 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