jest-preset-ttn
A jest preset for The Things Network repositories.
Usage
Install the package:
yarn add jest-preset-ttn --dev # or npm install jest-preset-ttn --save-dev
and use it in your jest config in package.json
:
Exposed config
Brief explanation
- It sets up jest to only test files of the format
*.test.js
- It transforms js files with
babel-preset-ttn
andes2015
to enable module transforms - It replaces style-like (
.css
,.styl
, ...) file imports with an empty object{}
. - It replaces file-like (
.jpeg
,.png
, ...) file imports with a string containing the filename.