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

refactor(core-api): pagination configuration through joi context #3955

Merged
merged 3 commits into from
Aug 13, 2020

Conversation

rainydio
Copy link
Contributor

Summary

Re-implemented #3940. Options were overwritten by { routes: { cors: true } }, now they are deep-merged.

Checklist

  • Ready to be merged

@codecov
Copy link

codecov bot commented Aug 12, 2020

Codecov Report

Merging #3955 into develop will decrease coverage by 83.80%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           develop    #3955       +/-   ##
============================================
- Coverage    97.56%   13.76%   -83.81%     
============================================
  Files          629      629               
  Lines        14541    14541               
  Branches      1730     1730               
============================================
- Hits         14187     2001    -12186     
- Misses         165    12425    +12260     
+ Partials       189      115       -74     
Flag Coverage Δ
#functional 6.82% <0.00%> (ø)
#integration 9.85% <100.00%> (ø)
#unit ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/core-api/src/schemas.ts 100.00% <100.00%> (ø)
packages/core-api/src/server.ts 78.26% <100.00%> (-21.74%) ⬇️
packages/core/src/cli.ts 0.00% <0.00%> (-100.00%) ⬇️
packages/core-p2p/src/errors.ts 0.00% <0.00%> (-100.00%) ⬇️
packages/core-p2p/src/schemas.ts 0.00% <0.00%> (-100.00%) ⬇️
packages/core/src/commands/top.ts 0.00% <0.00%> (-100.00%) ⬇️
packages/core-cli/src/contracts.ts 0.00% <0.00%> (-100.00%) ⬇️
packages/core-forger/src/errors.ts 0.00% <0.00%> (-100.00%) ⬇️
packages/core-p2p/src/constants.ts 0.00% <0.00%> (-100.00%) ⬇️
packages/core-p2p/src/listeners.ts 0.00% <0.00%> (-100.00%) ⬇️
... and 561 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 39894a4...e12df0c. Read the comment docs.

air1one
air1one previously approved these changes Aug 12, 2020
@rainydio
Copy link
Contributor Author

rainydio commented Aug 12, 2020

it("should fail to GET a wallet by the given invalid identifier", async () => {
  for (const value of invalidIdentifiers) {
-   api.expectError(await api.request("GET", `wallets/${value}`), 400);
+   api.expectError(await api.request("GET", `wallets/${value}`), 422);
  }
});

Because failAction in server.ts now isn't ignored API returns 422 instead of 400.

{
  "statusCode": 422,
  "error": "Unprocessable Entity",
  "message": "\"id\" does not match any of the allowed types"
}

@air1one air1one merged commit 8ebf821 into develop Aug 13, 2020
@ghost ghost deleted the refactor/core-api/joi-context-1 branch August 13, 2020 10:13
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.

None yet

2 participants