mardi 21 février 2017

At what level is the unit-under-test initialized in a Hapi Lab test suite?

I'm starting on a project which uses node.js and Hapi Lab, two technologies with which I am unfamiliar. I'm pouring through documentation on Lab, looking for similarities with tools that I am familiar with (such as Google Test).

Hapi Lab Docs

Here's what I'm looking for, and failing to find:

  • When is the unit-under-test initialized?
  • If the answer is not "at the beginning of each test execution", is the unit-under-test initialized when the experiment is initialized, and is state shared/persisted across test case execution?

The docs state that individual test case execution can be parallelized; this implies (to me) that each test case is initialized independently from all others, but I cannot find where this is stated explicitly.

Background: my team seems to think that it's important to restore any unit-under-test instance to its initial state at the end of the test case, so that it will not change the behavior for other tests. We tried writing example tests to demonstrate behavior, but were also unable to determine the execution order of the tests when executed with --shuffle, because the test report output seems to always be ordered to match the ordering of test declaration in the file. This lead to doubt that the test which changes the state of the production code ran first or last. Any insight into this detail would also be appreciated.

Help?

Thanks!

Aucun commentaire:

Enregistrer un commentaire