Class Jest.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.javascript.Jest.Builder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Jestbuild()Jest.BuilderconfigFilePath(String configFilePath)(experimental) Path to JSON config file for Jest.Jest.Buildercoverage(Boolean coverage)Deprecated.use jestConfig.collectCoverageJest.BuildercoverageText(Boolean coverageText)(experimental) Include thetextcoverage reporter, which means that coverage summary is printed at the end of the jest execution.static Jest.Buildercreate(NodeProject project)Jest.BuilderextraCliOptions(List<String> extraCliOptions)(experimental) Additional options to pass to the Jest CLI invocation.Jest.BuilderignorePatterns(List<String> ignorePatterns)Deprecated.use jestConfig.coveragePathIgnorePatterns or jestConfig.testPathIgnorePatterns respectivelyJest.BuilderjestConfig(JestConfigOptions jestConfig)(experimental) Jest configuration.Jest.BuilderjestVersion(String jestVersion)(experimental) The version of jest to use.Jest.BuilderjunitReporting(Boolean junitReporting)(experimental) Result processing with jest-junit.Jest.BuilderpreserveDefaultReporters(Boolean preserveDefaultReporters)(experimental) Preserve the default Jest reporter when additional reporters are added.Jest.BuilderupdateSnapshot(UpdateSnapshot updateSnapshot)(experimental) Whether to update snapshots in task "test" (which is executed in task "build" and build workflows), or create a separate task "test:update" for updating snapshots.
-
-
-
Method Detail
-
create
@Stability(Experimental) public static Jest.Builder create(NodeProject project)
- Parameters:
project- This parameter is required.- Returns:
- a new instance of
Jest.Builder.
-
configFilePath
@Stability(Experimental) public Jest.Builder configFilePath(String configFilePath)
(experimental) Path to JSON config file for Jest.Default: - No separate config file, jest settings are stored in package.json
- Parameters:
configFilePath- Path to JSON config file for Jest. This parameter is required.- Returns:
this
-
coverage
@Stability(Deprecated) @Deprecated public Jest.Builder coverage(Boolean coverage)
Deprecated.use jestConfig.collectCoverage(deprecated) Collect coverage.Deprecated
Default: true
- Parameters:
coverage- Collect coverage. This parameter is required.- Returns:
this
-
coverageText
@Stability(Experimental) public Jest.Builder coverageText(Boolean coverageText)
(experimental) Include thetextcoverage reporter, which means that coverage summary is printed at the end of the jest execution.Default: true
- Parameters:
coverageText- Include thetextcoverage reporter, which means that coverage summary is printed at the end of the jest execution. This parameter is required.- Returns:
this
-
extraCliOptions
@Stability(Experimental) public Jest.Builder extraCliOptions(List<String> extraCliOptions)
(experimental) Additional options to pass to the Jest CLI invocation.Default: - no extra options
- Parameters:
extraCliOptions- Additional options to pass to the Jest CLI invocation. This parameter is required.- Returns:
this
-
ignorePatterns
@Stability(Deprecated) @Deprecated public Jest.Builder ignorePatterns(List<String> ignorePatterns)
Deprecated.use jestConfig.coveragePathIgnorePatterns or jestConfig.testPathIgnorePatterns respectively(deprecated) DefinestestPathIgnorePatternsandcoveragePathIgnorePatterns.Default: ["/node_modules/"]
- Parameters:
ignorePatterns- DefinestestPathIgnorePatternsandcoveragePathIgnorePatterns. This parameter is required.- Returns:
this
-
jestConfig
@Stability(Experimental) public Jest.Builder jestConfig(JestConfigOptions jestConfig)
(experimental) Jest configuration.Default: - default jest configuration
- Parameters:
jestConfig- Jest configuration. This parameter is required.- Returns:
this
-
jestVersion
@Stability(Experimental) public Jest.Builder jestVersion(String jestVersion)
(experimental) The version of jest to use.Note that same version is used as version of
@types/jestandts-jest(if Typescript in use), so given version should work also for those.Default: - installs the latest jest version
- Parameters:
jestVersion- The version of jest to use. This parameter is required.- Returns:
this
-
junitReporting
@Stability(Experimental) public Jest.Builder junitReporting(Boolean junitReporting)
(experimental) Result processing with jest-junit.Output directory is
test-reports/.Default: true
- Parameters:
junitReporting- Result processing with jest-junit. This parameter is required.- Returns:
this
-
preserveDefaultReporters
@Stability(Experimental) public Jest.Builder preserveDefaultReporters(Boolean preserveDefaultReporters)
(experimental) Preserve the default Jest reporter when additional reporters are added.Default: true
- Parameters:
preserveDefaultReporters- Preserve the default Jest reporter when additional reporters are added. This parameter is required.- Returns:
this
-
updateSnapshot
@Stability(Experimental) public Jest.Builder updateSnapshot(UpdateSnapshot updateSnapshot)
(experimental) Whether to update snapshots in task "test" (which is executed in task "build" and build workflows), or create a separate task "test:update" for updating snapshots.Default: - ALWAYS
- Parameters:
updateSnapshot- Whether to update snapshots in task "test" (which is executed in task "build" and build workflows), or create a separate task "test:update" for updating snapshots. This parameter is required.- Returns:
this
-
-