16 lines
311 B
JavaScript
16 lines
311 B
JavaScript
|
expect.extend({
|
||
|
toBeEitherAFunctionOrAnObject(received) {
|
||
|
const type = typeof received;
|
||
|
|
||
|
const pass = ['object', 'function'].includes(type);
|
||
|
const message = `Expected a function or an object, received ${type}`;
|
||
|
|
||
|
return {
|
||
|
message,
|
||
|
pass,
|
||
|
};
|
||
|
},
|
||
|
});
|
||
|
|
||
|
jest.mock('./model/input');
|