Skip to content

Commit

Permalink
Use mock for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xouabita committed Sep 21, 2017
1 parent 48935ac commit fa9b48f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ const fakeWebpack = {
DefinePlugin,
}

beforeEach(() => jest.resetModules())
beforeEach(() => {
jest.doMock("is-heroku", () => false)
jest.resetModules()
})

test("return the same config if target is not node", () => {
const modify = require(".")
Expand Down Expand Up @@ -55,7 +58,7 @@ test("don't override the whole process.env if target is node", () => {
})

test("delete env.PORT and define process.env.RAZZLE_PUBLIC_DIR on heroku", () => {
process.env.HEROKU = 1
jest.doMock("is-heroku", () => true)
const modify = require(".")
const config = {
plugins: [
Expand Down

0 comments on commit fa9b48f

Please sign in to comment.