Accessing the original module when using mocks

jest.mock('fs')
const fs = require('fs') // Mocked module
const fs = require.requireActual('fs') // Original module

Leave a Reply

Your email address will not be published. Required fields are marked *