Lupa API Reference / @pawel-up/lupa/runner / configure
Function: configure()
configure(
options,args?):void
Defined in: src/runner/index.ts:98
Configure the Lupa test runner.
This function hydrates the provided configuration options and merges them with parsed CLI arguments.
Note: If you are using the standard npx lupa test CLI, you do not need to call this manually. The CLI automatically loads your lupa.config.ts and calls configure() for you. This function is exposed primarily for advanced users building custom integrations or programmatic runners.
You must call this function before calling run.
Parameters
options
The configuration object. You must provide either a top-level files array or a suites array to define your test files.
args?
Optional CLI arguments to override configuration.
Returns
void
Use When
Building a programmatic test runner or custom CLI integration.
Avoid When
You are already inside a running test or suite.
Examples
Basic Configuration
import { configure, run } from '@pawel-up/lupa/runner'
configure({
files: ['tests/**/*.spec.ts'],
testPlugins: ['@pawel-up/lupa/assert']
})
run()Using Test Suites
import { configure, run } from '@pawel-up/lupa/runner'
configure({
suites: [
{ name: 'components', files: ['tests/components/**/*.spec.ts'] },
{ name: 'e2e', files: ['tests/e2e/**/*.spec.ts'] }
],
timeout: 5000,
forceExit: true
})
run()