From 363481ed9b3b6435442bd28780c14279efb95879 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Mon, 10 Apr 2023 14:24:53 -0700 Subject: [PATCH] chore: fix typo in docstring (#118) --- docs/rules.md | 2 +- jest/defs.bzl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/rules.md b/docs/rules.md index 9cdc69d..0675648 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -26,7 +26,7 @@ Supports updating snapshots with `bazel run {name}_update_snapshots` if `snapsho | Name | Description | Default Value | | :------------- | :------------- | :------------- | | name | A unique name for this target. | none | -| node_modules | Label pointing to the linked node_modules target where jasmine is linked, e.g. //:node_modules. jest-cli must be linked into the node_modules supplied. jest-junit is also required by default when auto_configure_reporters is True | none | +| node_modules | Label pointing to the linked node_modules target where jest is linked, e.g. //:node_modules. jest-cli must be linked into the node_modules supplied. jest-junit is also required by default when auto_configure_reporters is True | none | | config | "Optional Jest config file. See https://jestjs.io/docs/configuration.

Supported config file types are ".js", ".cjs", ".mjs", ".json" which come from https://jestjs.io/docs/configuration minus TypeScript since we this rule extends from the configuration. TypeScript jest configs should be transpiled before being passed to jest_test with [rules_ts](https://github.com/aspect-build/rules_ts). | None | | data | Runtime dependencies of the Jest test.

This should include all test files, configuration files & files under test. | [] | | snapshots | If True, a {name}_update_snapshots binary target is generated that will update all existing __snapshots__ directories when bazel run. This is the equivalent to running jest -u or jest --updateSnapshot outside of Bazel, except that new __snapshots__ will not automatically be created on update. To bootstrap a new __snapshots__ directory, you can create an empty one and then run the {name}_update_snapshots target to populate it.

If the name of the snapshot directory is not the default __snapshots__ because of a custom snapshot resolver, you can specify customize the snapshot directories with a glob or a static list. For example,

 jest_test(     name = "test",     node_modules = "//:node_modules",     config = "jest.config.js",     data = [         "greetings/greetings.js",         "greetings/greetings.test.js",         "link/link.js",         "link/link.test.js",     ],     snapshots = glob(["**/__snaps__"], exclude_directories = 0), ) 


or with a static list,

     snapshots = [         "greetings/__greetings_snaps__",         "link/__link_snaps__",     ] 


Snapshots directories must not contain any files except for snapshots. There must also be no BUILD files in the snapshots directories since they must be part of the same Bazel package that the jest_test target is in.

If snapshots are _not_ configured to output to a directory that contains only snapshots, you may alternately set snapshots to a list of snapshot files expected to be generated by this jest_test target. These must be source files and all snapshots that are generated must be explicitly listed. You may use a glob such as glob(["**/*.snap"]) to generate this list, in which case all snapshots must already be on disk so they are discovered by glob. | False | diff --git a/jest/defs.bzl b/jest/defs.bzl index bf873d1..f3f8694 100644 --- a/jest/defs.bzl +++ b/jest/defs.bzl @@ -74,7 +74,7 @@ def jest_test( Args: name: A unique name for this target. - node_modules: Label pointing to the linked node_modules target where jasmine is linked, e.g. `//:node_modules`. + node_modules: Label pointing to the linked node_modules target where jest is linked, e.g. `//:node_modules`. `jest-cli` must be linked into the node_modules supplied. `jest-junit` is also required by default when `auto_configure_reporters` is True