Closed martijnvdbrug closed 2 months ago
The changes involve refactoring the test suite for the Vendure plugin's invoice generation and the introduction of a new polling mechanism for asynchronous operations. The fixed timeout approach has been replaced with a dynamic waiting strategy, enhancing the responsiveness of the tests. Additionally, a new helper function for polling conditions has been added to streamline the testing process across multiple files.
File Path | Change Summary |
---|---|
packages/vendure-plugin-invoices/test/e2e.spec.ts |
Refactored tests to use a new waitFor function for dynamic waiting on invoice generation. Added getLatestInvoice method. |
packages/vendure-plugin-shipping-extensions/test/test-helpers.ts |
Introduced a new asynchronous waitFor function to poll conditions with specified intervals and timeouts. |
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Description
Decreased test time by 50% by using
waitFor()
instead of arbitrary timeouts. Thanks @ZackNewResults
Before: ~39s After: ~22s
Checklist
📌 Always:
👍 Most of the time:
📦 For publishable packages:
package.json
CHANGELOG.md
See this example