Supporting different module types
This commit is contained in:
parent
4d31079ca2
commit
791142005e
@ -12,8 +12,8 @@ const buildMock = component => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
module.exports = path => {
|
module.exports = path => {
|
||||||
const actual = jest.requireActual(path).default;
|
const actual = jest.requireActual(path);
|
||||||
return buildMock(actual);
|
return buildMock(actual.default || actual);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.buildMock = buildMock;
|
module.exports.buildMock = buildMock;
|
||||||
|
Loading…
Reference in New Issue
Block a user