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

Validation of passed options #925

Open
kcebula opened this issue Dec 23, 2018 · 2 comments
Open

Validation of passed options #925

kcebula opened this issue Dec 23, 2018 · 2 comments

Comments

@kcebula
Copy link

kcebula commented Dec 23, 2018

Hello guys,

Recently I spent embarrassingly long amount of time looking for an error in my configuration (missed an 's' in 'astTransformers').
I thought that it would be fairly easy and quite helpful for people like me, to add a validation of passed options, with simple warning if any unknown option would be encountered.
I'd like to ask if you would be willing to accept PR bringing this change?

Issue :

ts-jest silently ignores unrecognized options
eg:

globals: {
    'ts-jest': {
      stringifyContentPathRegex: '\\.html$',
      tsConfig: 'tsconfig.json',
      astTransformer: [require.resolve('jest-preset-angular/InlineHtmlStripStylesTransformer')]
    },
  },

note missing 's' in 'astTransformers'

Expected behavior :

ts-lint warns when unrecognized option is entered in options

@GeeWee
Copy link
Collaborator

GeeWee commented Dec 23, 2018

I think this is a good idea. We might have to throw errors instead of warnings though. @huafu do you know if Jest still ignores what we log to the console?

@ahnpnl
Copy link
Collaborator

ahnpnl commented Dec 31, 2019

hi @kcebula , feel free to submit a PR to help us to improve this.

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

No branches or pull requests

3 participants