Skip to content

Commit

Permalink
fix: mock fs
Browse files Browse the repository at this point in the history
  • Loading branch information
shazron committed Aug 15, 2023
1 parent eaf879f commit 4ce7b29
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ const fetch = require('jest-fetch-mock')
const fileSystem = require('jest-plugin-fs').default

// dont touch the real fs
jest.mock('fs', () => require('jest-plugin-fs/mock'))
const mockFs = require('jest-plugin-fs/mock')

// jest-plugin-fs/mock is too old, and has no updates
// ... fs.rmSync is only available in node >= 14.
jest.mock('fs', () => ({
...mockFs,
rmSync: jest.fn()
}))

process.env.CI = true

Expand Down

0 comments on commit 4ce7b29

Please sign in to comment.