Skip to content

Commit fa21b70

Browse files
committed
fix(test): update mocking so that dependencies work
1 parent c308d3e commit fa21b70

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/helpers/verification.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const chance = new Chance()
99

1010
jest.mock('fs', () => {
1111
return {
12+
...jest.requireActual('fs'),
1213
existsSync: jest.fn(),
1314
}
1415
})
@@ -90,13 +91,12 @@ describe('checkZipSize', () => {
9091
})
9192

9293
afterEach(() => {
93-
jest.restoreAllMocks()
9494
delete process.env.DISABLE_BUNDLE_ZIP_SIZE_CHECK
9595
})
9696

9797
it('emits a warning that DISABLE_BUNDLE_ZIP_SIZE_CHECK was enabled', async () => {
98-
process.env.DISABLE_BUNDLE_ZIP_SIZE_CHECK = 'false'
98+
process.env.DISABLE_BUNDLE_ZIP_SIZE_CHECK = 'true'
9999
await checkZipSize(chance.string())
100-
expect(consoleSpy).toHaveBeenCalledWith('Function bundle size check was DISABLED with the DISABLE_BUNDLE_ZIP_SIZE_CHECK environment. Your deployment will break if it exceeds the maximum supported size of function zip files in your account.')
100+
expect(consoleSpy).toHaveBeenCalledWith('Function bundle size check was DISABLED with the DISABLE_BUNDLE_ZIP_SIZE_CHECK environment variable. Your deployment will break if it exceeds the maximum supported size of function zip files in your account.')
101101
})
102102
})

0 commit comments

Comments
 (0)