Builds the merged qunitx config from package.json settings and either an argv or an explicit
ConfigOptions. package.json#qunitx.plugins entries are dynamic-imported into esbuild
plugin objects.
Resolved settings handed to setup in place of an argv, by the JS API and by anyone else assembling a run programmatically. Every CLI flag has a field here — they are the same settings, arrived at by a different route — plus the two things argv cannot express: a working directory, and esbuild plugins as live objects rather than module specifiers.
-
console: Console
Where reporter text and
#diagnostics go. Defaults to the process streams; passsilentConsolefor a run that prints nothing at all. Named apart fromoutput— the build directory — because they are unrelated and both spellings are load-bearing. -
cwd: string
Directory the project root and relative inputs resolve against. Defaults to
process.cwd(). -
esbuildPlugins: EsbuildPlugin[]
Live esbuild plugin objects, appended after any resolved from
package.json#qunitx.plugins. -
reporters: ReporterInstance[]
Reporter instances for this run, replacing the one
reporter/junitwould have selected. The way a caller observes a run as data rather than as text. -
signal: AbortSignal
Cancels the run when it fires. Placed on
state.signal; setup never subscribes to it.
| ProjectRootNotFoundFailure
| FSTree.InputUnreadableFailure
| Result.Failure.Of<InvalidPlugins | PluginLoadFailed>
Every way config assembly can fail with something the user can act on.
package.json#qunitx.plugins was present but not an array.
A plugin specifier could not be resolved or imported.
Usage
import * as mod from "lib/setup/config.ts";