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

Issues with parallel testing #50

Open
JbIPS opened this issue Jun 9, 2021 · 1 comment
Open

Issues with parallel testing #50

JbIPS opened this issue Jun 9, 2021 · 1 comment

Comments

@JbIPS
Copy link
Contributor

JbIPS commented Jun 9, 2021

Hi,

I'm trying to switch my test suite to a parallel runner (AVA in this case) but there is some issues with sinon spies. Since this helper use a NodeRED instance from cache, each call to .load() will try to wrap the logger.

I tried to instantiate a new helper for each test, but the root problem is the RED instance.

I have several ideas but I don't know which one to explore:

  • This is impossible 😢
  • Busting require.cache and create a new RED instance each time 💥
  • Test if the logger is already wrapped before wrapping it (or catch exception?) 🎁
  • Give the choice to the user to use spy or not 👨‍🚀

Do you have any advice/feedback for this case? Thank you

@biancode
Copy link

Same problem with jest and test.concurrent - spy of "log" raises an exception that it was wrapped before or again, while the tests created new instances of the test-helper per test - the first test works well, but all other tests do not. The log.restore.sinon is true instead false as if it is a shared stack for all tests. I try to digg deeper for this to solve that problem if it is possible to solve it.

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

No branches or pull requests

2 participants