Skip to content

Commit

Permalink
avoid Node v14 nodejs/node#32987
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmarkclements committed Apr 13, 2021
1 parent 62cb2aa commit 9ab88fa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions loader.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ if (workerData) {
process.on('exit', (code) => {
meta[0] = code
})

const stdin = new ReadStream(fd)
stdin.unref()
stdin.on('data', (buf) => {
Expand All @@ -56,7 +55,7 @@ global[kMockalicious] = ({ counter, file, entry, names, mocks } = {}) => {
require.cache[kMockalicious] = require.cache[kMockalicious] || {}
for (const name of names) {
require.cache[kMockalicious][name] = {
exports: mocks[name].default || mocks[name]
exports: 'default' in mocks[name] ? mocks[name].default : mocks[name]
}
Object.defineProperty(require.cache, require.resolve(name), {
configurable: true,
Expand Down

0 comments on commit 9ab88fa

Please sign in to comment.