Skip to content

Commit 287772b

Browse files
committed
fix (tests): Mocks interfering with e2e tests
1 parent b251762 commit 287772b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

__tests__/webpackConfig.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { chainWebpack } = require('../lib/webpackConfig')
22
const Config = require('webpack-chain')
33
const webpack = require('webpack')
44
const fs = require('fs')
5-
5+
jest.mock('fs')
66
// Set for Electron builds
77
process.env.IS_ELECTRON = true
88

@@ -86,7 +86,7 @@ describe('chainWebpack', () => {
8686
dependencies: { mockExternal: 'mockExternal' }
8787
}))
8888
const { readFileSync: realReadFileSync } = fs
89-
fs.readFileSync = jest.fn((path, ...args) => {
89+
fs.readFileSync.mockImplementationOnce((path, ...args) => {
9090
if (path === 'mockExternalPath') {
9191
return JSON.stringify({})
9292
}

0 commit comments

Comments
 (0)