Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Michsior14 opened this issue Oct 4, 2024 · 0 comments

Comments

@Michsior14
Copy link

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));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant