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

Multiple test files #2

Open
EcksDy opened this issue Jul 29, 2023 · 0 comments
Open

Multiple test files #2

EcksDy opened this issue Jul 29, 2023 · 0 comments

Comments

@EcksDy
Copy link

EcksDy commented Jul 29, 2023

Hey, thank you for taking the time to dig into this!
I've tried running this repo with multiple .test.ts files, and it seems to break the injection:

  ● Test suite failed to run

    Cannot find module 'vscode'
    Require stack:
    - /home/ecksdy/Projects/jest-tests/src/test/vscode-environment.js
    - /home/ecksdy/Projects/jest-tests/node_modules/jest-util/build/requireOrImportModule.js
    - /home/ecksdy/Projects/jest-tests/node_modules/jest-util/build/index.js
    - /home/ecksdy/Projects/jest-tests/node_modules/jest-resolve/build/resolver.js
    - /home/ecksdy/Projects/jest-tests/node_modules/jest-resolve/build/index.js
    - /home/ecksdy/Projects/jest-tests/node_modules/jest-runtime/build/index.js
    - /home/ecksdy/Projects/jest-tests/node_modules/jest-runner/build/testWorker.js
    - /home/ecksdy/Projects/jest-tests/node_modules/jest-worker/build/workers/processChild.js

      3 | const vscode = require("vscode");
      4 |
    > 5 | class VsCodeEnvironment extends TestEnvironment {
        |                ^
      6 |   async setup() {
      7 |     await super.setup();
      8 |     this.global.vscode = vscode;

      at Object.<anonymous> (src/test/vscode-environment.js:5:16)

Both files will fail with this error. Running 1 file only works fine.

Do you have any idea how to remedy this?

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