@nrwl/jest

  • Version 15.2.4
  • Published
  • 211 kB
  • 12 dependencies
  • MIT license

Install

npm i @nrwl/jest
yarn add @nrwl/jest
pnpm add @nrwl/jest

Overview

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

Index

Functions

function addPropertyToJestConfig

addPropertyToJestConfig: (
host: Tree,
path: string,
propertyName: string,
value: unknown,
options?: { valueAsString: boolean }
) => void;
  • Add a property to the jest config

    Parameter host

    Parameter path

    path to the jest config file

    Parameter propertyName

    Property to update. Can be dot delimited to access deeply nested properties

    Parameter value

    Parameter options

    set valueAsString option to true if the value being passed represents a string of the code that should be associated with the propertyName

function getJestProjects

getJestProjects: () => string[];

    function jestConfigObjectAst

    jestConfigObjectAst: (fileContent: string) => ts.ObjectLiteralExpression;
    • Should be used to get the jest config object as AST

    function jestInitGenerator

    jestInitGenerator: (tree: Tree, schema: JestInitSchema) => GeneratorCallback;

      function jestProjectGenerator

      jestProjectGenerator: (
      tree: Tree,
      schema: JestProjectSchema
      ) => Promise<import('@nrwl/devkit').GeneratorCallback>;

        function removePropertyFromJestConfig

        removePropertyFromJestConfig: (
        host: Tree,
        path: string,
        propertyName: string
        ) => void;
        • Remove a property value from the jest config

          Parameter host

          Parameter path

          Parameter propertyName

          Property to remove. Can be dot delimited to access deeply nested properties

        Package Files (6)

        Dependencies (12)

        Dev Dependencies (0)

        No dev dependencies.

        Peer Dependencies (0)

        No peer dependencies.

        Badge

        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@nrwl/jest.

        • Markdown
          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@nrwl/jest)
        • HTML
          <a href="https://www.jsdocs.io/package/@nrwl/jest"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>