/jest-preset-typescript

A preset for jest (utilizing ts-jest) that eliminates the need for manual configuration of jest settings

Primary LanguageTypeScript

jest-preset-typescript

Build Status NPM Version

A preset that can be used to quickly get up and running with jest + typescript.

Install

yarn add jest ts-jest typescript jest-preset-typescript --dev

or with npm if that's more your style 😎

npm install jest ts-jest typescript jest-preset-typescript --save-dev

(note: if you already have the peer dependencies installed, you only need to install jest-preset-typescript!)

Then, once all dependencies are installed, simply create a jest.config.js in the root of your project with the following contents:

module.exports = {
  preset: 'jest-preset-typescript'
};

Features

All of the features come courtesy of ts-jest, so simply add this preset and you can author your tests/mocks/etc. in TypeScript, all the while getting the excellent testing capabilities of jest. 🎉