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

feat!: update dep, TS arg validation, stricter internal TS #242

Merged
merged 6 commits into from
Sep 12, 2021

Conversation

rwalle61
Copy link
Collaborator

@rwalle61 rwalle61 commented Aug 31, 2021

  • feat: improve Typescript hints for the filepathOrObject arg

  • refactor: much stricter internal use of TypeScript

  • BREAKING CHANGE: this updates our validation dependency by 2 major versions, so validation error messages (and maybe validation rules) are slightly different. For example, res did not satisfy it because: property1 should be string, property2 should be string is now res did not satisfy it because: property1 must be string, property2 must be string (should -> must). We expect our users to read these error messages during testing but not assert on them, such that this change shouldn't break anyone's existing tests. Moreover, renaming should to must does not indicate that the validation rule has changed. However, it is possible that other validation rules have changed

BREAKING CHANGE: slightly different validation error output. Validation rules
may have changed slightly too
BREAKING CHANGE: no longer include the type of the provided filepathOrObject arg
as the user already knows what the type is, and we're about to provide
TypeScript hints anyway

Also minor refactor in openapi-validator and using TypeScript properly
Also refactor: use TypeScript properly in jest-openapi
Also refactor: use TypeScript properly in chai plugin
@codecov
Copy link

codecov bot commented Aug 31, 2021

Codecov Report

Merging #242 (8141cf9) into master (f9a9767) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #242   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines          394       421   +27     
  Branches        49        58    +9     
=========================================
+ Hits           394       421   +27     
Impacted Files Coverage Δ
packages/jest-openapi/src/index.ts 100.00% <100.00%> (ø)
...ages/jest-openapi/src/matchers/toSatisfyApiSpec.ts 100.00% <100.00%> (ø)
...t-openapi/src/matchers/toSatisfySchemaInApiSpec.ts 100.00% <100.00%> (ø)
packages/jest-openapi/src/utils.ts 100.00% <100.00%> (ø)
...enapi-validator/lib/classes/AbstractOpenApiSpec.ts 100.00% <100.00%> (ø)
.../openapi-validator/lib/classes/AbstractResponse.ts 100.00% <100.00%> (ø)
...ges/openapi-validator/lib/classes/AxiosResponse.ts 100.00% <100.00%> (ø)
...ages/openapi-validator/lib/classes/OpenApi2Spec.ts 100.00% <100.00%> (ø)
...ages/openapi-validator/lib/classes/OpenApi3Spec.ts 100.00% <100.00%> (ø)
...pi-validator/lib/classes/RequestPromiseResponse.ts 100.00% <100.00%> (ø)
... and 7 more

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 f9a9767...8141cf9. Read the comment docs.

@rwalle61 rwalle61 force-pushed the typescript-no-implicit-any branch 2 times, most recently from cfd305b to 031ff9e Compare September 12, 2021 11:07
Although TypeScript users won't need this because the argument is now
typed, it is still useful for JavaScript users
@rwalle61 rwalle61 force-pushed the typescript-no-implicit-any branch from 031ff9e to 8141cf9 Compare September 12, 2021 11:08
@rwalle61 rwalle61 merged commit 04b3d88 into master Sep 12, 2021
@rwalle61 rwalle61 deleted the typescript-no-implicit-any branch September 12, 2021 11:19
@rwalle61 rwalle61 changed the title Improve TypeScript (no implicit any) feat!: update dep, TS arg validation, stricter internal TS Sep 12, 2021
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

Successfully merging this pull request may close these issues.

1 participant