Skip to content

Commit

Permalink
default default mock value to named exports (for cjs)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChALkeR committed Jul 16, 2024
1 parent 1a84a91 commit c52410c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jest.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export function jestmock(name, mocker) {
syncBuiltinESMExports()
}

mock.module(name, { defaultExport: value.default, namedExports: value })
mock.module(name, { defaultExport: value.default ?? value, namedExports: value })

return this
}

0 comments on commit c52410c

Please sign in to comment.