nestjs
nestjs copied to clipboard
bug(@golevelup/ts-jest): Cannot convert object to primitive value at RegExp.test
In all versions after 0.5.0 if somewhere in the code the RegExp.test is used on mocked object property then tests fails.
This can be simply reproduced using bellow test snipped, by e.g. putting it in packages/testing/ts-jest/src/mocks.spec.ts.
it('should work with RegExp', () => {
type SimpleType = {
field: string;
};
const mock = createMock<SimpleType>();
expect(/test/.test(mock.field));
});
This issue is stale because it has been open for 30 days with no activity.