Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "ts-jest", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"main": "index.ts", | ||
@@ -5,0 +5,0 @@ "description": "A preprocessor with sourcemap support to help use Typescript with Jest", |
@@ -1,20 +0,17 @@ | ||
# typescript-jest | ||
# ts-jest | ||
[![Build Status](https://semaphoreci.com/api/v1/k/typescript-jest/branches/master/badge.svg)](https://semaphoreci.com/k/typescript-jest) | ||
[![Build Status](https://semaphoreci.com/api/v1/k/ts-jest/branches/master/badge.svg)](https://semaphoreci.com/k/ts-jest) | ||
**Note:** This is currently just a hack and most likely not suitable for all setups. | ||
**Note:** This is currently just a hack and might not be suitable for all setups. | ||
## Details | ||
This repo uses code from the [source-map-support](https://github.com/evanw/node-source-map-support) package to show errors with mapped locations. | ||
> **Note:** This repo uses code from the [source-map-support](https://github.com/evanw/node-source-map-support) package to show errors with mapped locations. | ||
To use this in its current form, clone this repo anywhere on your disk. Run `npm install` in it. | ||
Create a symlink in the `node_modules` directory of your project to this directory: | ||
To use this in your project, run: | ||
```sh | ||
ln -s path-to-typescript-jest | ||
npm install --save-dev ts-jest | ||
``` | ||
such that you effectively have a `node_modules/typescript-jest` directory. | ||
Modify your project's `package.json` so that the `jest` section looks something like: | ||
@@ -25,3 +22,3 @@ | ||
"jest": { | ||
"scriptPreprocessor": "<rootDir>/node_modules/typescript-jest/preprocessor.js", | ||
"scriptPreprocessor": "<rootDir>/node_modules/ts-jest/preprocessor.js", | ||
"testFileExtensions": [ | ||
@@ -41,3 +38,3 @@ "ts", | ||
"<rootDir>/node_modules/react-addons-test-utils/", | ||
"<rootDir>/node_modules/typescript-jest/" | ||
"<rootDir>/node_modules/ts-jest/" | ||
], | ||
@@ -54,11 +51,13 @@ "globals": { | ||
This should allow you to write Jest tests in Typescript and be able to locate errors without any additional gymnastics. | ||
> **Note:** It's currently necessary to have `globals > __TS_CONFIG__` present in your `package.json` even if it is only an empty object. | ||
This setup should allow you to write Jest tests in Typescript and be able to locate errors without any additional gymnastics. | ||
If you have any suggestions/pull requests to turn this into a useful package, just open an issue and I'll be happy to work with you to improve this. | ||
## Quickstart to run tests | ||
## Quickstart to run tests (only if you're working on this package) | ||
```sh | ||
git clone https://github.com/kulshekhar/typescript-jest | ||
cd typescript-jest | ||
git clone https://github.com/kulshekhar/ts-jest | ||
cd ts-jest | ||
npm install | ||
@@ -69,6 +68,6 @@ ./test-init.sh | ||
It is assumed that `typescript` and `jest-cli` are globally installed. If not, please do so: | ||
It is assumed that `jest-cli` is globally installed. If not, please do so: | ||
```sh | ||
npm i -g typescript jest-cli | ||
npm i -g jest-cli | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21352
69