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

Unexpected token 'export' #32

Closed
vasilii-kovalev opened this issue Jul 29, 2021 · 1 comment
Closed

Unexpected token 'export' #32

vasilii-kovalev opened this issue Jul 29, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@vasilii-kovalev
Copy link
Owner

When using ts-jest to transform files in Jest tests, the following error occurs:

export { configureHydrateText, hydrateText };
^^^^^^

SyntaxError: Unexpected token 'export'
@vasilii-kovalev vasilii-kovalev added the bug Something isn't working label Jul 29, 2021
@vasilii-kovalev vasilii-kovalev self-assigned this Jul 29, 2021
@vasilii-kovalev
Copy link
Owner Author

According to this comment, all you have to do to eliminate the error is to define two more parameters in Jest config:

{
  "transformIgnorePatterns": ["node_modules/(?!(hydrate-text)/)"],
  "preset": "ts-jest/presets/js-with-ts"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant