Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Commit c17719c

Browse files
committed
add reset for testing purposes
1 parent c4556f2 commit c17719c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const debug = require('debug')('cypress:webpack')
55
const createDeferred = require('./deferred')
66
const stubbableRequire = require('./stubbable-require')
77

8-
const bundles = {}
8+
let bundles = {}
99

1010
// we don't automatically load the rules, so that the babel dependencies are
1111
// not required if a user passes in their own configuration
@@ -200,4 +200,9 @@ Object.defineProperty(preprocessor, 'defaultOptions', {
200200
},
201201
})
202202

203+
// for testing purposes
204+
preprocessor.__reset = () => {
205+
bundles = {}
206+
}
207+
203208
module.exports = preprocessor

test/e2e/e2e_spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ describe('webpack preprocessor - e2e', () => {
1313
let filePath
1414

1515
beforeEach(() => {
16+
preprocessor.__reset()
1617
fs.removeSync(path.join(__dirname, '_test-output'))
1718

1819
const originalFilePath = path.join(__dirname, '..', 'fixtures', 'example_spec.js')

0 commit comments

Comments
 (0)