Skip to content

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

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

Open
Michsior14 opened this issue Oct 4, 2024 · 1 comment
Labels

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

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

@github-actions github-actions bot added the stale label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant