Skip to content

Commit

Permalink
feat: passthrough test runner args after --
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjastrzebski committed Jul 3, 2024
1 parent 7d6639e commit 782afb1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/cli/src/commands/measure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ export async function run(options: MeasureOptions) {
const defaultTestMatch = '**/*.perf-test.[jt]s?(x)';
const testMatch = options.testMatch || defaultTestMatch;

const defaultArgs = `--runInBand --testMatch "<rootDir>/${testMatch}"`;
const baseTestRunnerArgs = process.env.TEST_RUNNER_ARGS ?? defaultArgs;
const passthroughArgs = options._ ?? [];
const jestDefaultArgs = `--runInBand --testMatch "<rootDir>/${testMatch}"`;
const baseRunnerArgs = process.env.TEST_RUNNER_ARGS ?? jestDefaultArgs;
const passthroughRunnerArgs = options._ ?? [];

const nodeMajorVersion = getNodeMajorVersion();
logger.verbose(`Node.js version: ${nodeMajorVersion} (${process.versions.node})`);

const nodeArgs = [...getNodeFlags(nodeMajorVersion), testRunnerPath, baseTestRunnerArgs, ...passthroughArgs];
const nodeArgs = [...getNodeFlags(nodeMajorVersion), testRunnerPath, baseRunnerArgs, ...passthroughRunnerArgs];
logger.verbose('Running tests using command:');
logger.verbose(`$ node \\\n ${nodeArgs.join(' \\\n ')}\n`);

Expand Down

0 comments on commit 782afb1

Please sign in to comment.