Skip to content

Commit

Permalink
Set NODE_ENV to test in Jest (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
etaoins authored Jan 25, 2021
1 parent f78afbc commit 739ce3a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changeset/thick-bees-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'skuba': patch
---

**test:** Set `NODE_ENV=test`

This is something that Jest itself does in its `bin/jest`.
5 changes: 5 additions & 0 deletions src/cli/test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { run } from 'jest';

export const test = () => {
// This is usually set in `jest-cli`'s binary wrapper
if (typeof process.env.NODE_ENV === 'undefined') {
process.env.NODE_ENV = 'test';
}

const argv = process.argv.slice(2);

return run(argv);
Expand Down

0 comments on commit 739ce3a

Please sign in to comment.