Skip to content

Commit

Permalink
Load Jest test environment with .env.sample vars
Browse files Browse the repository at this point in the history
Next isn't instantiated by Jest, so we need to explicitly tell it
where to get env vars. Using .env.sample as I don't see a need for
more specialised .env.test or other file for our values which are
all test strings.

vercel/next.js#16443
  • Loading branch information
neilvanbeinum committed Jan 19, 2021
1 parent 5ff35b0 commit dc5da87
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions setupTests.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
import '@testing-library/jest-dom/extend-expect'

import dotenv from 'dotenv'
dotenv.config({ path: '.env.sample' })

0 comments on commit dc5da87

Please sign in to comment.