Back to Nuxt

nuxt test

docs/4.api/4.commands/test.md

4.4.41.4 KB
Original Source
<!--test-cmd-->
bash
npx nuxt test [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--dev] [--watch]
<!--/test-cmd-->

The test command runs tests using @nuxt/test-utils. This command sets process.env.NODE_ENV to test if not already set.

Arguments

<!--test-args-->
ArgumentDescription
ROOTDIR="."Specifies the working directory (default: .)
<!--/test-args-->

Options

<!--test-opts-->
OptionDefaultDescription
--cwd=<directory>Specify the working directory, this takes precedence over ROOTDIR (default: .)
--logLevel=<silent|info|verbose>Specify build-time log level
--devRun in dev mode
--watchWatch mode
<!--/test-opts-->

::note This command sets process.env.NODE_ENV to test. ::