You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while testing the file ts jest file getting issue like
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.
By default "node_modules" folder is ignored by transformers. syntaxError: <filePath>: Missing initializer in const declaration at line const data: [] = useSeelctor(ssMethod);
a.tsx
import {ssMethod} from './b.ts';
const data: [] = useSeelctor(ssMethod);
b.ts
export const ssMethod = createSelector([data], data => data);
a.test.js
imported all necessary modules which are used for testing
test("first", () => {
render();
});
Expected behavior
Run test cases as it is
Actual behavior
Error like: syntaxError: : Missing initializer in const declaration.
Additional context
No response
Environment
jest: 29.7.0
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Version
29.7.0
Steps to reproduce
while testing the file ts jest file getting issue like
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
a.tsx
import {ssMethod} from './b.ts';
const data: [] = useSeelctor(ssMethod);
b.ts
export const ssMethod = createSelector([data], data => data);
a.test.js
imported all necessary modules which are used for testing
test("first", () => {
render();
});
Expected behavior
Run test cases as it is
Actual behavior
Error like: syntaxError: : Missing initializer in const declaration.
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: