neume-network / core

A socially-scalable music NFT indexer.
https://neume.network
GNU General Public License v3.0
26 stars 11 forks source link

add test to check worker creation in boot.mjs #66

Closed il3ven closed 2 years ago

il3ven commented 2 years ago

Partially fix #65

This PR adds a test for boot.mjs to check creation of worker. In situations when worker data is incorrect the test will fail.

I couldn't add a test for worker_start.mjs. The main reason is that isMainThread is false due to ava executing the tests in a worker thread.

https://github.com/neume-network/core/blob/472f9ef9c4ccc9555496fa8bc1f2cccf38d9df60/src/worker_start.mjs#L20-L25

TimDaub commented 2 years ago

thanks for nudging me.

I couldn't add a test for worker_start.mjs. The main reason is that isMainThread is false due to ava executing the tests in a worker thread.

that's fine, I guess we don't even need that code anymore

il3ven commented 2 years ago

Yes, it fails when the worker data is changed. Merging the PR and closing the issue.

https://user-images.githubusercontent.com/4337699/177646260-319ca58f-3d44-4ca0-a850-eeeffd6ded0b.mov