webpack-contrib / istanbul-instrumenter-loader

Istanbul Instrumenter Loader
MIT License
273 stars 65 forks source link

feat: add `options` validation (`schema-utils`) #65

Closed michael-ciniawsky closed 6 years ago

michael-ciniawsky commented 6 years ago

~Blocked by #63~

mattlewis92 commented 6 years ago

Good idea! This is semver major btw as the loader will throw on invalid options now: https://github.com/webpack-contrib/schema-utils/blob/master/src/validateOptions.js#L20

michael-ciniawsky commented 6 years ago

You're right but luckily v3.0.0 is in beta atm πŸ˜…

What about sourceMapUrlCallback?

It's a {Function} which isn't directly supported by ajv (JSON Schema) and I hadn't the time to look into a custom extension to support this type in schema-utils yet, but it is highly needed :). additionalProperties: true is the workaround meanwhile πŸ˜›

mattlewis92 commented 6 years ago

Fair enough πŸ™‚

mattlewis92 commented 6 years ago

@michael-ciniawsky can you rebase this on master? πŸ˜„ Also might be worth adding a test that it throws on an invalid option type.

codecov[bot] commented 6 years ago

Codecov Report

Merging #65 into master will increase coverage by 1.39%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #65      +/-   ##
=========================================
+ Coverage    90.9%   92.3%   +1.39%     
=========================================
  Files           2       2              
  Lines          11      13       +2     
  Branches        2       2              
=========================================
+ Hits           10      12       +2     
  Misses          1       1
Impacted Files Coverage Ξ”
src/index.js 91.66% <100%> (+1.66%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update 4525107...e516db6. Read the comment docs.

codecov[bot] commented 6 years ago

Codecov Report

Merging #65 into master will increase coverage by 1.39%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #65      +/-   ##
=========================================
+ Coverage    90.9%   92.3%   +1.39%     
=========================================
  Files           2       2              
  Lines          11      13       +2     
  Branches        2       2              
=========================================
+ Hits           10      12       +2     
  Misses          1       1
Impacted Files Coverage Ξ”
src/index.js 91.66% <100%> (+1.66%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update 4525107...678a8d0. Read the comment docs.