Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-preset-ttn

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-preset-ttn

A preset for jest

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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:

{
  "jest": {
    "preset": "jest-preset-ttn"
  }
}

Exposed config

{
  "testMatch": [
    "**/*.test.js"
  ],
  "transform": {
    "^.+\\.js$": "<rootDir>/node_modules/jest-preset-ttn/transform.js",
    "\\.(css|styl|less|sass)$": "<rootDir>/node_modules/jest-preset-ttn/styles.transform.js",
    "\\.(jpg|jpeg|svg)$": "<rootDir>/node_modules/jest-preset-ttn/files.transform.js"
  },
  "moduleNameMapper": {
    "~/(.*)": "<rootDir>/src/$1"
  }
}

Brief explanation

  • It sets up jest to only test files of the format *.test.js
  • It transforms js files with babel-preset-ttn and es2015 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.

FAQs

Package last updated on 11 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc