Skip to content

Commit

Permalink
fix: TEST_RUNNER_PATH not being applied (#325)
Browse files Browse the repository at this point in the history
* fix: TEST_RUNNER_PATH usage

* refactor: self code review

* chore: add changeset
  • Loading branch information
mdjastrzebski authored Jan 26, 2023

Verified

This commit was signed with the committer’s verified signature.
1 parent 4514352 commit ff5e2ff
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/metal-laws-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@callstack/reassure-cli': patch
---

fix: handling of TEST_RUNNER_PATH env variable
9 changes: 4 additions & 5 deletions packages/reassure-cli/src/commands/measure.ts
Original file line number Diff line number Diff line change
@@ -36,12 +36,11 @@ export async function run(options: MeasureOptions) {
const header = { metadata };
writeFileSync(outputFile, JSON.stringify(header) + '\n');

const testRunnerPath =
process.env.TEST_RUNNER_PATH ?? process.platform === 'win32'
? 'node_modules/jest/bin/jest'
: 'node_modules/.bin/jest';
const defaultPath = process.platform === 'win32' ? 'node_modules/jest/bin/jest' : 'node_modules/.bin/jest';
const testRunnerPath = process.env.TEST_RUNNER_PATH ?? defaultPath;

const testRunnerArgs = process.env.TEST_RUNNER_ARGS ?? '--runInBand --testMatch "<rootDir>/**/*.perf-test.[jt]s?(x)"';
const defaultArgs = '--runInBand --testMatch "<rootDir>/**/*.perf-test.[jt]s?(x)"';
const testRunnerArgs = process.env.TEST_RUNNER_ARGS ?? defaultArgs;

const spawnInfo = spawnSync(
'node',

0 comments on commit ff5e2ff

Please sign in to comment.