@nrwl/jest

  • Version 15.8.9
  • Published
  • 245 kB
  • 13 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 | 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 or an array 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 getNestedJestProjects

    getNestedJestProjects: () => string[];
    • a list of nested projects that have jest configured to be used in the testPathIgnorePatterns property of a given jest config https://jestjs.io/docs/configuration#testpathignorepatterns-arraystring

    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
    ) => Promise<GeneratorCallback>;

      function jestProjectGenerator

      jestProjectGenerator: (
      tree: Tree,
      schema: JestProjectSchema
      ) => Promise<GeneratorCallback>;

        function removePropertyFromJestConfig

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

          Parameter host

          Parameter path

          Parameter propertyName

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

        Package Files (6)

        Dependencies (13)

        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>