Skip to content

Commit f9603f8

Browse files
committed
Fix test utils
1 parent 9a9c617 commit f9603f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/commons/utils/TestUtils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ export function deepFilter<T>(
8787
export function resolveImportInconsistency(json: any) {
8888
// `json` doesn't inherit from `Object`?
8989
// Can't use hasOwnProperty for some reason.
90-
if ('default' in json) {
90+
const hasDefaultExport =
91+
process.env.NODE_ENV === 'test' ? 'default' in json : json.hasOwnProperty('default');
92+
if (hasDefaultExport) {
9193
return json.default;
9294
} else {
9395
return json;

0 commit comments

Comments
 (0)