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

@common-web/jest

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@common-web/jest

Common jest configuration

  • 1.0.7
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Common jest config

Supports typescript and modern es6 features out of the box in test code base, using the transformers:

  • ts-jest
  • babel-jest

the configuration defaults to looking for test files in the src/ folder under tests

Getting started

Install the pkg:

yarn:

yarn add @common-web/jest -D

npm:

npm install @common-web/jest --save-dev

in your repo create jest.config.js file with the following code:

const commonConfig = require('@common-web/jest');

module.exports = commonConfig;

Changing common configurations, if you need to change paths or ignore certain files:

const commonConfig = require('@common-web/jest');

// Defines the "src" of the test files
process.env.COMMON_JEST_ROOT = 'my/new/root';

// Support additional extensions in your application 
process.env.COMMON_JEST_FILE_EXTENSIONS = 'svg';

// Add additional ignore patterns
process.env.COMMON_JEST_IGNORE_PATTERNS = 'dist/**';

module.exports = commonConfig;

Adding the script to (package.json)

{
    ...

    "scripts": {
        "test": "jest -c ./jest.config.js"
    }
}

For more information and options for jest cli please see official docs - here

Running the jest

yarn run test

or

npm run test

FAQs

Package last updated on 13 Dec 2020

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