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

Unable to point testEnvironment to a node module in stencil.config.ts #2425

Closed
toureholder opened this issue May 7, 2020 · 1 comment
Closed
Labels

Comments

@toureholder
Copy link

toureholder commented May 7, 2020

Stencil version:

 @stencil/core@1.12.2

I'm submitting a:

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior:
Tests do not run when pointing testEnvironment to a node module in stencil.config.ts. Jest looks for the module in /path/to/my/project/stencil.config.ts/<module name>

Expected behavior:

Tests should run when pointing testEnvironment to a node module in stencil.config.ts as described in Configuring Jest Guide.

Steps to reproduce:

  1. Set testEnvironment to "jsdom" in stencil.config.ts.
  2. Run tests with npm test
  3. Observe error:
[ ERROR ]  runJest: ● Validation Error: Test environment
           C:/path/to/my/project/stencil.config.ts/jsdom
           cannot be found. Make sure the testEnvironment configuration option
           points to an existing node module. Configuration Documentation:
           https://jestjs.io/docs/configuration.html

Related code:
I set testEnvironment to "jsdom" in stencil.config.ts like this:

  testing: {
    testEnvironment: "jsdom"
  }
@ionitron-bot ionitron-bot bot added the triage label May 7, 2020
@toureholder toureholder changed the title Tests do not run when pointing testEnvironment to a node module in stencil.config.ts Unable to point testEnvironment to a node module in stencil.config.ts May 7, 2020
@toureholder
Copy link
Author

I've opend a PR for this: #2534

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

Successfully merging a pull request may close this issue.

1 participant