malijs / mali

A minimalistic gRPC microservice framework for Node.js
https://mali.js.org
Apache License 2.0
887 stars 59 forks source link

Modernize tests #377

Closed n0v1 closed 6 months ago

n0v1 commented 6 months ago

I thought some random test failures discussed in #375 might have been caused by the relatively old ava version, so I updated it to the latest version.

ava v4 removed test.cb, so I rewrote those tests to use promises and async/await.

After those changes tests sometimes still failed with No address added out of total 1 resolved. Probably because ava runs test files in parallel by default which could cause random port clashes. To solve this, this sets "concurrency": 1 which essentially disables running of tests in parallel processes (see ava options).

If using util.promisify is preferred over manually creating promises for method calls, I'm happy to change this.

anonrig commented 6 months ago

Can you also add Node 20 and 22 into Github workflow, and remove 16?

coveralls commented 6 months ago

Coverage Status

coverage: 98.243%. remained the same when pulling 74379d9392dc6fd7a2c76bd3188a90d39b1e9d4c on n0v1:modernize-tests into 3859690cf421c6b0e43d6c04976d0062d81fb1b8 on malijs:master.

n0v1 commented 6 months ago

Can you also add Node 20 and 22 into Github workflow, and remove 16?

Done.

n0v1 commented 6 months ago

Thanks for merging. I noticed that tests sometimes still fail with No address added out of total 1 resolved. I created pull request #378 to hopefully fix this. Sorry for the noise.