Class Jest
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- software.constructs.Construct
-
- io.github.cdklabs.projen.Component
-
- io.github.cdklabs.projen.javascript.Jest
-
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.96.0 (build 921e240)", date="2024-03-28T21:16:43.165Z") @Stability(Experimental) public class Jest extends Component
(experimental) Installs the following npm scripts:.test, intended for testing locally and in CI. Will update snapshots unlessupdateSnapshot: UpdateSnapshot: NEVERis set.test:watch, intended for automatically rerunning tests when files change.test:update, intended for testing locally and updating snapshots to match the latest unit under test. Only available whenupdateSnapshot: UpdateSnapshot: NEVER.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJest.Builder(experimental) A fluent builder forJest.
-
Constructor Summary
Constructors Modifier Constructor Description Jest(NodeProject project)Jest(NodeProject project, JestOptions options)protectedJest(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)protectedJest(software.amazon.jsii.JsiiObjectRef objRef)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIgnorePattern(String pattern)voidaddModuleNameMappers(Map<String,Object> moduleNameMapperAdditions)(experimental) Adds one or more moduleNameMapper entries to Jest's configuration.voidaddModulePaths(@NotNull String... modulePaths)(experimental) Adds one or more modulePaths to Jest's configuration.voidaddReporter(JestReporter reporter)voidaddRoots(@NotNull String... roots)(experimental) Adds one or more roots to Jest's configuration.voidaddSetupFile(String file)(experimental) Adds a a setup file to Jest's setupFiles configuration.voidaddSetupFileAfterEnv(String file)(experimental) Adds a a setup file to Jest's setupFilesAfterEnv configuration.voidaddSnapshotResolver(String file)voidaddTestMatch(String pattern)(experimental) Adds a test match pattern.voidaddWatchIgnorePattern(String pattern)(experimental) Adds a watch ignore pattern.ObjectgetConfig()(experimental) Escape hatch.JsonFilegetFile()(experimental) Jest config file.StringgetJestVersion()(experimental) Jest version, including@symbol, like@^29.static Jestof(Project project)(experimental) Returns the singleton Jest component of a project or undefined if there is none.-
Methods inherited from class io.github.cdklabs.projen.Component
getProject, isComponent, postSynthesize, preSynthesize, synthesize
-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
-
-
-
Constructor Detail
-
Jest
protected Jest(software.amazon.jsii.JsiiObjectRef objRef)
-
Jest
protected Jest(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
Jest
@Stability(Experimental) public Jest(@NotNull NodeProject project, @Nullable JestOptions options)- Parameters:
project- This parameter is required.options-
-
Jest
@Stability(Experimental) public Jest(@NotNull NodeProject project)- Parameters:
project- This parameter is required.
-
-
Method Detail
-
of
@Stability(Experimental) @Nullable public static Jest of(@NotNull Project project)
(experimental) Returns the singleton Jest component of a project or undefined if there is none.- Parameters:
project- This parameter is required.
-
addIgnorePattern
@Stability(Experimental) public void addIgnorePattern(@NotNull String pattern)- Parameters:
pattern- This parameter is required.
-
addModuleNameMappers
@Stability(Experimental) public void addModuleNameMappers(@NotNull Map<String,Object> moduleNameMapperAdditions)(experimental) Adds one or more moduleNameMapper entries to Jest's configuration.Will overwrite if the same key is used as a pre-existing one.
- Parameters:
moduleNameMapperAdditions-- A map from regular expressions to module names or to arrays of module names that allow to stub out resources, like images or styles with a single module.
-
addModulePaths
@Stability(Experimental) public void addModulePaths(@NotNull @NotNull String... modulePaths)(experimental) Adds one or more modulePaths to Jest's configuration.- Parameters:
modulePaths-- An array of absolute paths to additional locations to search when resolving modules *.
-
addReporter
@Stability(Experimental) public void addReporter(@NotNull JestReporter reporter)- Parameters:
reporter- This parameter is required.
-
addRoots
@Stability(Experimental) public void addRoots(@NotNull @NotNull String... roots)(experimental) Adds one or more roots to Jest's configuration.- Parameters:
roots-- A list of paths to directories that Jest should use to search for files in.
-
addSetupFile
@Stability(Experimental) public void addSetupFile(@NotNull String file)(experimental) Adds a a setup file to Jest's setupFiles configuration.- Parameters:
file- File path to setup file. This parameter is required.
-
addSetupFileAfterEnv
@Stability(Experimental) public void addSetupFileAfterEnv(@NotNull String file)(experimental) Adds a a setup file to Jest's setupFilesAfterEnv configuration.- Parameters:
file- File path to setup file. This parameter is required.
-
addSnapshotResolver
@Stability(Experimental) public void addSnapshotResolver(@NotNull String file)- Parameters:
file- This parameter is required.
-
addTestMatch
@Stability(Experimental) public void addTestMatch(@NotNull String pattern)(experimental) Adds a test match pattern.- Parameters:
pattern- glob pattern to match for tests. This parameter is required.
-
addWatchIgnorePattern
@Stability(Experimental) public void addWatchIgnorePattern(@NotNull String pattern)(experimental) Adds a watch ignore pattern.- Parameters:
pattern- The pattern (regular expression). This parameter is required.
-
getConfig
@Stability(Experimental) @NotNull public Object getConfig()
(experimental) Escape hatch.
-
getJestVersion
@Stability(Experimental) @NotNull public String getJestVersion()
(experimental) Jest version, including@symbol, like@^29.
-
getFile
@Stability(Experimental) @Nullable public JsonFile getFile()
(experimental) Jest config file.undefinedif settings are written topackage.json
-
-