Skip to content

Conversation

seriousme
Copy link
Contributor

This PR:

  • introduces t.plan in all tests to ensure that all asserts are evaluated
  • restructures the tests so that in case of failure you directly get access to the specific test instead of the same function that executes all tests
  • changes nearly all callbacks to async/await to ensure that all errors are caught.
  • has been tested with aedes-persistence-redis. These tests d̀id complete without requiring process.exit(0) but you need to disable waitForReady:true for these tests as the ready event seems to come too early.
  • adds a new test to test suite that tests the working of the ẁaitForReady:true

Hope this helps,
Hans

@seriousme
Copy link
Contributor Author

After testing abstract.js with aedes-persistence-level I got a warning:
[DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake.
So I decided to remove promisify in doCleanup().

Copy link
Member

@robertsLando robertsLando left a comment

Choose a reason for hiding this comment

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

@seriousme well done with this refactor! Looks good overall, just wondering why coveralls detects a decrease of coverage

@robertsLando robertsLando merged commit b6a7510 into moscajs:main Mar 12, 2025
5 of 6 checks passed
@seriousme
Copy link
Contributor Author

@seriousme well done with this refactor! Looks good overall, just wondering why coveralls detects a decrease of coverage

@robertsLando Just checked the coverage report: it turns out the async test missed the waitForReady:true flag :-(
This left waitForEvent() uncalled, and therefore coverage dropped. All other coverage misses are untriggered errors in promises.

@robertsLando
Copy link
Member

robertsLando commented Mar 12, 2025

it turns out the async test missed the waitForReady:true flag :-(
This left waitForEvent() uncalled, and therefore coverage dropped

Could you fix that? Then I will release a patch

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.

2 participants