Skip to content

Test executor

The test executor runs Go tests using go test ./....

nx test my-go-project
OptionTypeDefaultDescription
coverbooleanfalseEnable coverage analysis.
coverProfilestring-Write a coverage profile to the file after all tests have passed.
racebooleanfalseEnable the race detector.
runstring-Run only tests matching this regular expression.
verbosebooleanfalseEnable verbose test output.
countnumber-Run each test N times.
timeoutstring10mPanic if a test binary runs longer than this duration. Set to 0 to disable.

Inferred for all Go projects (applications and libraries):

{
  "executor": "@naxodev/gonx:test",
  "cache": true,
  "dependsOn": ["generate", "^build"],
  "inputs": ["{projectRoot}/go.mod", "{projectRoot}/go.sum", "{projectRoot}/**/*.{go}"]
}

The ^build dependency means test targets run after upstream project build targets complete.