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

chore: update critical packages, fix tests, update error check #186

Merged
merged 4 commits into from
Jan 6, 2023

Conversation

denisand
Copy link
Contributor

@denisand denisand commented Jan 5, 2023

Description

  • Update critical packages as result of npm audit
  • Update mollie api client version on notification (that broke the tests)
  • Update error check as result of previous step
  • Fix tests as result from second step
  • Update mocked in tests with jest.mocked as result of removed ts-jest/utils from v28.0.0 on (feat(core): remove ts-jest/utils sub path export kulshekhar/ts-jest#3334)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Testing

  • Run the tests

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation where necessary
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works/doesn't break everything
  • Existing tests pass locally with my changes

@@ -7,7 +7,7 @@ export default async function getPaymentDetailsById(paymentId: string, mollieCli
return payment;
} catch (error: any) {
Logger.debug('Error in getPaymentDetailsById');
if (error.status === 404) {
if (error.statusCode === 404) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since 2.6.0 mollie-api-node returns statusCode instead of status, check mollie/mollie-api-node@v3.5.1...v3.6.0 and find src/errors/ApiError.ts

@@ -7,7 +7,7 @@ export default async function getOrderDetailsById(orderId: string, mollieClient:
return order;
} catch (error: any) {
Logger.debug('Error in getOrderDetailsById');
if (error.status === 404) {
if (error.statusCode === 404) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since 2.6.0 mollie-api-node returns statusCode instead of status, check mollie/mollie-api-node@v3.5.1...v3.6.0 and find src/errors/ApiError.ts

@@ -40,8 +39,8 @@ describe('handleRequest', () => {
Logger.error = mockLogError;
Logger.debug = mockLogDebug;

mocked(handleOrderWebhook).mockResolvedValue(mockCTPayment);
mocked(handlePaymentWebhook).mockResolvedValue(mockCTPayment);
jest.mocked(handleOrderWebhook).mockResolvedValue(mockCTPayment);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ts-jest/utils and mocked are removed from v28.0.0 on (kulshekhar/ts-jest#3334), reworked as suggested on their repo

Copy link
Contributor

@lebradley lebradley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed it & LGTM 👍

@denisand denisand merged commit be9e7b1 into develop Jan 6, 2023
@denisand denisand deleted the feat/178-maintenance-dependencies-update-packages branch January 6, 2023 15:07
@denisand denisand linked an issue Jan 9, 2023 that may be closed by this pull request
3 tasks
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.

Maintenance dependencies
2 participants