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]: Missing Initializer in const declaration #15075

Closed
TVDharma opened this issue May 18, 2024 · 2 comments
Closed

[Bug]: Missing Initializer in const declaration #15075

TVDharma opened this issue May 18, 2024 · 2 comments
Labels
Bug Report Needs Reproduction Every bug report requires a minimal reproduction Needs Triage

Comments

@TVDharma
Copy link

TVDharma commented May 18, 2024

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.

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
@SimenB SimenB added the Needs Reproduction Every bug report requires a minimal reproduction label May 18, 2024
Copy link

As noted in the Bug Report template, all bug reports requires a minimal reproduction. Please open up a new issue providing one. Read more at https://stackoverflow.com/help/minimal-reproducible-example.

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Report Needs Reproduction Every bug report requires a minimal reproduction Needs Triage
Projects
None yet
Development

No branches or pull requests

2 participants