Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

jest-preset-ns

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-preset-ns

An opinionated Jest preset for both react and non-react projects

Source
npmnpm
Version
2.1.1
Version published
Maintainers
1
Created
Source

jest-preset-ns

npm version Node CI

An opinionated Jest preset for both react and non-react projects.

It comes with two default presets with both babel and typescript support.

Features

  • default preset and preset for react are available
  • modern javascript (babel) and typescript (ts-jest) support
  • mocks files (eg. png, gif, jpg, ...) and date (jest-date-mock) automatically
  • looks for tests in __tests__ and for *.(spec|test).[jt]s(x)? files
  • easy extendable

Installation

npm install --save-dev jest-preset-ns jest
# or
yarn add jest-preset-ns jest --dev

Usage

Add jest-preset-ns as preset to your Jest config. This can be done by adding it to your package.json or jest.config.js:

// package.json
{
  "jest": {
    "preset": "jest-preset-ns"
  }
}
// jest.config.js
module.exports = {
  preset: 'jest-preset-ns',
  // or: preset: 'jest-preset-ns/presets/default'
  // [...]
}

Feel free to extend the "jest"-configuration object along the way with your own settings.

For running tests, use the Jest CLI.

Compatibility

This package is compatible only with React 16+.

Helpful tips

How to Publish

# create the tags and the version
yarn lerna:version

# create the changelog entry
npx lerna-changelog --from <tag> --to <tag>
git add CHANGELOG.md && git commit -m "chore: updated CHANGELOG"

# push the tags and the changelog update
git push --follow-tags

# publish to npm
yarn lerna:publish

References

Keywords

jest

FAQs

Package last updated on 14 Aug 2022

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