Cutwater

Cutwater

  • Docs
  • Help
  • GitHub

JestTask

@codification/cutwater-build-core > JestTask

Class

beta:

Hierarchy

↳ BaseExecTask<JestConfig>

↳ JestTask

Implements

  • IExecutable

Constructors

  • constructor

Properties

  • argNames
  • buildConfig
  • cleanMatch
  • cmdName
  • enabled
  • name
  • optsUseEquals
  • schema
  • taskConfig

Accessors

  • junitOutputFile

Methods

  • _getConfigFilePath
  • copyFile
  • execute
  • executeTask
  • fileError
  • fileExists
  • fileWarning
  • getCleanMatch
  • isEnabled
  • loadSchema
  • log
  • logError
  • logVerbose
  • logWarning
  • mergeConfig
  • onRegister
  • readJSONSync
  • replaceConfig
  • resolvePath
  • setConfig

Constructors

constructor

⊕ new JestTask(packageName?: undefined | string): JestTask

Overrides BaseExecTask.constructor

Defined in JestTask.ts:59

Parameters:

NameType
Optional packageNameundefined \string

Returns: JestTask


Properties

<Protected> argNames

● argNames: string[]

Inherited from BaseExecTask.argNames

Defined in BaseExecTask.ts:10


buildConfig

● buildConfig: IBuildConfig

Inherited from GulpTask.buildConfig

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:20

The global build configuration object. Will be the same for all task instances.


cleanMatch

● cleanMatch: string[]

Inherited from GulpTask.cleanMatch

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:30

An overridable array of file patterns which will be utilized by the CleanTask to determine which files to delete. Unless overridden, the getCleanMatch() function will return this value.


<Protected> cmdName

● cmdName: string

Inherited from BaseExecTask.cmdName

Defined in BaseExecTask.ts:9


enabled

● enabled: boolean

Inherited from GulpTask.enabled

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:36

Indicates whether this task should be executed or not. This toggle is used by isEnabled() to determine if the task should run. Since some tasks have more complex logic to determine if they should run or not, the isEnabled() function can be overridden.


name

● name: string

Inherited from GulpTask.name

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:16

The name of the task. The configuration file with this name will be loaded and applied to the task.


<Protected> optsUseEquals

● optsUseEquals: boolean

Inherited from BaseExecTask.optsUseEquals

Defined in BaseExecTask.ts:11


schema

● schema: Object | undefined

Inherited from GulpTask.schema

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:55

A JSON Schema object which will be used to validate this task's configuration file.

returns: a z-schema schema definition


taskConfig

● taskConfig: JestConfig

Inherited from GulpTask.taskConfig

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:24

The configuration for this task instance.


Accessors

junitOutputFile

set junitOutputFile(output: string): void

Defined in JestTask.ts:74

Parameters:

NameType
outputstring

Returns: void


Methods

<Protected> _getConfigFilePath

▸ _getConfigFilePath(): string

Inherited from GulpTask._getConfigFilePath

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:172

Returns the path to the config file used to configure this task

Returns: string


copyFile

▸ copyFile(localSourcePath: string, localDestPath?: undefined | string): void

Inherited from GulpTask.copyFile

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:157

Copy a file from one location to another.

Parameters:

NameTypeDescription
localSourcePathstringpath to the source file
Optional localDestPathundefined \stringpath to the destination file

Returns: void


execute

▸ execute(config: IBuildConfig): Promise<void>

Inherited from GulpTask.execute

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:139

This function is called once to execute the task. It calls executeTask() and handles the return value from that function. It also provides some utilities such as logging how long each task takes to execute.

Parameters:

NameTypeDescription
configIBuildConfigthe buildConfig which is applied to the task instance before execution

Returns: Promise<void> a Promise which is completed when the task is finished executing


executeTask

▸ executeTask(): Promise<void>

Inherited from BaseExecTask.executeTask

Overrides GulpTask.executeTask

Defined in BaseExecTask.ts:29

Returns: Promise<void>


fileError

▸ fileError(filePath: string, line: number, column: number, errorCode: string, message: string): void

Inherited from GulpTask.fileError

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:115

Logs an error regarding a specific file to standard error and causes the build to fail.

Parameters:

NameTypeDescription
filePathstringthe path to the file which encountered an issue
linenumberthe line in the file which had an issue
columnnumberthe column in the file which had an issue
errorCodestringthe custom error code representing this error
messagestringa description of the error

Returns: void


fileExists

▸ fileExists(localPath: string): boolean

Inherited from GulpTask.fileExists

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:151

Synchronously detect if a file exists.

Parameters:

NameTypeDescription
localPathstringthe path to the file [resolved using resolvePath()]

Returns: boolean true if the file exists, false otherwise


fileWarning

▸ fileWarning(filePath: string, line: number, column: number, warningCode: string, message: string): void

Inherited from GulpTask.fileWarning

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:124

Logs a warning regarding a specific file.

Parameters:

NameTypeDescription
filePathstringthe path to the file which encountered an issue
linenumberthe line in the file which had an issue
columnnumberthe column in the file which had an issue
warningCodestringthe custom warning code representing this warning
messagestringa description of the warning

Returns: void


getCleanMatch

▸ getCleanMatch(buildConfig: IBuildConfig, taskConfig?: TTaskConfig): string[]

Inherited from GulpTask.getCleanMatch

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:131

An overridable function which returns a list of glob patterns representing files that should be deleted by the CleanTask.

Parameters:

NameTypeDescription
buildConfigIBuildConfigthe current build configuration
Optional taskConfigTTaskConfiga task instance's configuration

Returns: string[]


isEnabled

▸ isEnabled(buildConfig: IBuildConfig): boolean

Inherited from GulpTask.isEnabled

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:50

Overridable function which returns true if this task should be executed, or false if it should be skipped.

Parameters:

NameTypeDescription
buildConfigIBuildConfigthe build configuration which should be used when determining if the task is enabled

Returns: boolean true if the build is not redundant and the enabled toggle is true


<Protected> loadSchema

▸ loadSchema(): Object | undefined

Inherited from GulpTask.loadSchema

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:168

Override this function to provide a schema which will be used to validate the task's configuration file. This function is called once per task instance.

Returns: Object | undefined a z-schema schema definition


log

▸ log(message: string): void

Inherited from GulpTask.log

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:90

Logs a message to standard output.

Parameters:

NameTypeDescription
messagestringthe message to log to standard output.

Returns: void


logError

▸ logError(message: string): void

Inherited from GulpTask.logError

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:106

Logs an error to standard error and causes the build to fail.

Parameters:

NameTypeDescription
messagestringthe error description

Returns: void


logVerbose

▸ logVerbose(message: string): void

Inherited from GulpTask.logVerbose

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:95

Logs a message to standard output if the verbose flag is specified.

Parameters:

NameTypeDescription
messagestringthe message to log when in verbose mode

Returns: void


logWarning

▸ logWarning(message: string): void

Inherited from GulpTask.logWarning

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:101

Logs a warning. It will be logged to standard error and cause the build to fail if buildConfig.shouldWarningsFailBuild is true, otherwise it will be logged to standard output.

Parameters:

NameTypeDescription
messagestringthe warning description

Returns: void


mergeConfig

▸ mergeConfig(taskConfig: Partial<JestConfig>): void

Inherited from GulpTask.mergeConfig

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:67

Deep merges config settings into task config. Do not use this function if the configuration contains complex objects that cannot be merged.

Parameters:

NameTypeDescription
taskConfigPartial<JestConfig>configuration settings which should be applied

Returns: void


onRegister

▸ onRegister(): void

Inherited from GulpTask.onRegister

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:77

This function is called when the task is initially registered into gulp-core-build as a task or subtask. It reads the configuration file, validates it against the schema, then applies it to the task instance's configuration.

Returns: void


readJSONSync

▸ readJSONSync(localPath: string): Object | undefined

Inherited from GulpTask.readJSONSync

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:162

Read a JSON file into an object

Parameters:

NameTypeDescription
localPathstringthe path to the JSON file

Returns: Object | undefined


replaceConfig

▸ replaceConfig(taskConfig: JestConfig): void

Inherited from GulpTask.replaceConfig

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:72

Replaces all of the task config settings with new settings.

Parameters:

NameTypeDescription
taskConfigJestConfigthe new task configuration

Returns: void


resolvePath

▸ resolvePath(localPath: string): string

Inherited from GulpTask.resolvePath

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:145

Resolves a path relative to the buildConfig.rootPath.

Parameters:

NameTypeDescription
localPathstringa relative or absolute path

Returns: string If localPath is relative, returns an absolute path relative to the rootPath. Otherwise, returns localPath.


setConfig

▸ setConfig(taskConfig: Partial<JestConfig>): void

Inherited from GulpTask.setConfig

Defined in /home/circleci/cutwater/node_modules/@microsoft/gulp-core-build/lib/tasks/GulpTask.d.ts:61

Shallow merges config settings into the task config. Note this will override configuration options for those which are objects.

Parameters:

NameTypeDescription
taskConfigPartial<JestConfig>configuration settings which should be applied

Returns: void


  • Class
  • Hierarchy
  • Implements
    • Constructors
    • Properties
    • Accessors
    • Methods
  • Constructors
    • constructor
  • Properties
    • `` argNames
    • buildConfig
    • cleanMatch
    • `` cmdName
    • enabled
    • name
    • `` optsUseEquals
    • schema
    • taskConfig
  • Accessors
    • junitOutputFile
  • Methods
    • `` _getConfigFilePath
    • copyFile
    • execute
    • executeTask
    • fileError
    • fileExists
    • fileWarning
    • getCleanMatch
    • isEnabled
    • `` loadSchema
    • log
    • logError
    • logVerbose
    • logWarning
    • mergeConfig
    • onRegister
    • readJSONSync
    • replaceConfig
    • resolvePath
    • setConfig
Cutwater
Docs
Getting Started
Community
Stack Overflow
More
GitHubStar
Copyright © 2019 Codification.org