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

@nx/jest

Package Overview
Dependencies
Maintainers
4
Versions
764
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nx/jest

The Nx Plugin for Jest contains executors and generators allowing your workspace to use the powerful Jest testing capabilities.

  • 20.2.0-canary.20241127-b018b94
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2M
decreased by-8.11%
Maintainers
4
Weekly downloads
 
Created

What is @nx/jest?

@nx/jest is a package that integrates Jest testing framework with Nx, a set of extensible dev tools for monorepos. It allows you to run and manage Jest tests efficiently within an Nx workspace.

What are @nx/jest's main functionalities?

Running Jest Tests

This configuration allows you to run Jest tests for multiple projects within an Nx workspace. The 'projects' array specifies the paths to the projects you want to include.

module.exports = {
  projects: ['<rootDir>/apps/my-app', '<rootDir>/libs/my-lib'],
};

Custom Jest Configuration

This sample shows how to create a custom Jest configuration for a specific project within an Nx workspace. It includes settings for transforming files, module file extensions, and coverage directory.

module.exports = {
  displayName: 'my-app',
  preset: '../../jest.preset.js',
  transform: {
    '^.+\\.[tj]sx?$': 'babel-jest',
  },
  moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
  coverageDirectory: '../../coverage/apps/my-app',
};

Running Tests with Nx CLI

You can run tests for a specific project using the Nx CLI. This command runs the tests for the 'my-app' project.

nx test my-app

Other packages similar to @nx/jest

Keywords

FAQs

Package last updated on 27 Nov 2024

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