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

jest test failed to run #386

Open
BurtHarris opened this issue Jul 15, 2022 · 1 comment
Open

jest test failed to run #386

BurtHarris opened this issue Jul 15, 2022 · 1 comment

Comments

@BurtHarris
Copy link

BurtHarris commented Jul 15, 2022

Describe the bug
Test suit fails. I suspect it is related to ES modules.
In this case the test was launched by a VSCode add-in for Jest. I will research and add more details.
Repro setup just like #385, but I ran git and npm install.

** messages **

[my-app]: Scheduled test run "watch-tests-1" for "orta.vscode-jest:my-app"
 FAIL  src/main.spec.ts
  ● Test suite failed to run

    src/main.spec.ts:25:39 - error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.

    25     const dir = dirname(fileURLToPath(import.meta.url))
                                             ~~~~~~~~~~~

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        3.21 s

* Screenshot *

![image](https://user-images.githubusercontent.com/2715647/179315420-bd6038da-b13e-41d3-a660-b35ec153fd0a.png)
@BurtHarris
Copy link
Author

It passes when run by the NPM script. So this is probably something specific to the jest extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant