Skip to content

Commit

Permalink
Ignore .env.local in test environment (facebook#2250)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored and romaindso committed Jul 10, 2017
1 parent 2d841b8 commit 91ff0b4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/react-scripts/config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ if (!NODE_ENV) {
var dotenvFiles = [
`${paths.dotenv}.${NODE_ENV}.local`,
`${paths.dotenv}.${NODE_ENV}`,
`${paths.dotenv}.local`,
// Don't include `.env.local` for `test` environment
// since normally you expect tests to produce the same
// results for everyone
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
paths.dotenv,
];
].filter(Boolean);

// Load environment variables from .env* files. Suppress warnings using silent
// if this file is missing. dotenv will never modify any environment variables
// that have already been set.
Expand Down

0 comments on commit 91ff0b4

Please sign in to comment.