We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
4.19.2
When setting certain properties in Stencil's testing config, such as restoreMocks: true, I get TypeScript errors.
restoreMocks: true
Full list of properties in the JestConfig interface that are incompatible with Jest's Config type:
JestConfig
Config
bail
globalSetup
globalTeardown
preset
prettierPath
resolver
restoreMocks
testRegex
transform
These errors should not occur. Setting this property to a boolean is correct, why does it expect a string?
Set the testing.restoreMocks property in stencil.config.ts
testing.restoreMocks
stencil.config.ts
export const config: Config = { // ... testing: { // ... restoreMocks: true, }, };
TypeScript will throw the following error:
Types of property 'restoreMocks' are incompatible. Type 'boolean' is not assignable to type 'string'.
Looks like the JestConfig interface contains incorrect types.
stencil/src/declarations/stencil-public-compiler.ts
Line 1790 in 7ae36aa
Could this be updated to use the Config type directly from Jest, instead of defining your own interface?
import type { Config as JestConfig } from 'jest'; export interface TestingConfig extends JestConfig { // ... }
The text was updated successfully, but these errors were encountered:
@punit-shah thanks for reporting. These types were updated in Jest but never revisited in Stencil. I raised a PR with an update.
Sorry, something went wrong.
christian-bromann
Successfully merging a pull request may close this issue.
Prerequisites
Stencil version
4.19.2
Current behavior
When setting certain properties in Stencil's testing config, such as
restoreMocks: true
, I get TypeScript errors.Full list of properties in the
JestConfig
interface that are incompatible with Jest'sConfig
type:bail
globalSetup
globalTeardown
preset
prettierPath
resolver
restoreMocks
testRegex
transform
Expected behavior
These errors should not occur. Setting this property to a boolean is correct, why does it expect a string?
Steps to reproduce
Set the
testing.restoreMocks
property instencil.config.ts
TypeScript will throw the following error:
Additional information
Looks like the
JestConfig
interface contains incorrect types.stencil/src/declarations/stencil-public-compiler.ts
Line 1790 in 7ae36aa
Could this be updated to use the
Config
type directly from Jest, instead of defining your own interface?The text was updated successfully, but these errors were encountered: