Class JestOptions.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.javascript.JestOptions.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<JestOptions>
- Enclosing interface:
- JestOptions
@Stability(Experimental) public static final class JestOptions.Builder extends Object implements software.amazon.jsii.Builder<JestOptions>
A builder forJestOptions
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
configFilePath
@Stability(Experimental) public JestOptions.Builder configFilePath(String configFilePath)
Sets the value ofJestOptions.getConfigFilePath()- Parameters:
configFilePath- Path to JSON config file for Jest.- Returns:
this
-
coverage
@Stability(Deprecated) @Deprecated public JestOptions.Builder coverage(Boolean coverage)
Deprecated.use jestConfig.collectCoverageSets the value ofJestOptions.getCoverage()- Parameters:
coverage- Collect coverage. Deprecated- Returns:
this
-
coverageText
@Stability(Experimental) public JestOptions.Builder coverageText(Boolean coverageText)
Sets the value ofJestOptions.getCoverageText()- Parameters:
coverageText- Include thetextcoverage reporter, which means that coverage summary is printed at the end of the jest execution.- Returns:
this
-
extraCliOptions
@Stability(Experimental) public JestOptions.Builder extraCliOptions(List<String> extraCliOptions)
Sets the value ofJestOptions.getExtraCliOptions()- Parameters:
extraCliOptions- Additional options to pass to the Jest CLI invocation.- Returns:
this
-
ignorePatterns
@Stability(Deprecated) @Deprecated public JestOptions.Builder ignorePatterns(List<String> ignorePatterns)
Deprecated.use jestConfig.coveragePathIgnorePatterns or jestConfig.testPathIgnorePatterns respectivelySets the value ofJestOptions.getIgnorePatterns()- Parameters:
ignorePatterns- DefinestestPathIgnorePatternsandcoveragePathIgnorePatterns.- Returns:
this
-
jestConfig
@Stability(Experimental) public JestOptions.Builder jestConfig(JestConfigOptions jestConfig)
Sets the value ofJestOptions.getJestConfig()- Parameters:
jestConfig- Jest configuration.- Returns:
this
-
jestVersion
@Stability(Experimental) public JestOptions.Builder jestVersion(String jestVersion)
Sets the value ofJestOptions.getJestVersion()- Parameters:
jestVersion- 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.- Returns:
this
-
junitReporting
@Stability(Experimental) public JestOptions.Builder junitReporting(Boolean junitReporting)
Sets the value ofJestOptions.getJunitReporting()- Parameters:
junitReporting- Result processing with jest-junit. Output directory istest-reports/.- Returns:
this
-
preserveDefaultReporters
@Stability(Experimental) public JestOptions.Builder preserveDefaultReporters(Boolean preserveDefaultReporters)
Sets the value ofJestOptions.getPreserveDefaultReporters()- Parameters:
preserveDefaultReporters- Preserve the default Jest reporter when additional reporters are added.- Returns:
this
-
updateSnapshot
@Stability(Experimental) public JestOptions.Builder updateSnapshot(UpdateSnapshot updateSnapshot)
Sets the value ofJestOptions.getUpdateSnapshot()- 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.- Returns:
this
-
build
@Stability(Experimental) public JestOptions build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<JestOptions>- Returns:
- a new instance of
JestOptions - Throws:
NullPointerException- if any required attribute was not provided
-
-