nestjs icon indicating copy to clipboard operation
nestjs copied to clipboard

bug(@golevelup/ts-jest): Cannot convert object to primitive value at RegExp.test

Open Michsior14 opened this issue 1 year ago • 1 comments

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));
});

Michsior14 avatar Oct 04 '24 11:10 Michsior14

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Feb 11 '25 02:02 github-actions[bot]