-
-
Notifications
You must be signed in to change notification settings - Fork 49
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: Jest test fails with marker #189
Comments
I just ran into this issue too, you happen to know a workaround for time being? |
not yet, I jusst updated my repo example. |
Yeah I ran into the same it seemed solved, then I ran into flat. and after that it said ... is not a function ( the marker function ). |
Another thing to add that might be related, storybook also fails with the following error message:
We have a UI component with some default text, which is overriden by input. But by default the UI component just uses a default translation ( with marker function etc ). |
Here's a workaround for Jest until this gets fixed. Put it in your test-setup: jest.mock('@jsverse/transloco-keys-manager/marker', () => ({
marker: jest.fn(),
})); |
I ran into another problem with a test somewhere I edited the workaround to: jest.mock('@jsverse/transloco-keys-manager/marker', () => ({
marker: jest.fn((x) => x),
})); So it mimics the implementation |
@JelleBruisten Which version are you using? there was an issue with the marker export. I need to review all the suggestions and try to document which path mostly resolves the issue, same goes here as this is now an ESM package. If @JelleBruisten solution resolves the issue I'll add it as a section in the docs. |
We are on |
@shaharkazaz in the example repo attached, I've added a simple jest test for the app component where the marker is used. |
Is there an existing issue for this?
Is this a regression?
No
Current behavior
I just moved from ngneat/transloco-keys-manager to jsverse/transloco-keys-manager v4.0.1.
When running my Jest tests, I get following error inside every file where I am using the marker.
Expected behavior
I shouldn't get syntax error in my jest test when using marker.
Please provide a link to a minimal reproduction of the bug
https://github.com/mirinio/jest-transloco-issue
Transloco Config
Debug Logs
No response
Please provide the environment you discovered this bug in
Additional context
No response
I would like to make a pull request for this bug
No
The text was updated successfully, but these errors were encountered: