Skip to content

Commit

Permalink
Ignore .env.local in test environment (#2250)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored May 19, 2017
1 parent 1834cb5 commit f3f5599
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 f3f5599

Please sign in to comment.