I have a challenge in writing complex tests, and looking for suggestions on how to approach it.
I have a workflow process that needs to be tested, and I want to check the functioning of the workflow engine. This will consist of opening and completing a sequence of workflow steps, and checking that it works along the way.
The standard meteor/mocha testing allows me to write a
describe() block, and
it() blocks within it. Each
it() block needs to be executed in order, as each one depends on the previous one. Mocha runs each
it() block independently, and I can’t work out how to prevent that. I tried nesting more
describe() blocks within, and also tried using the
I can make a large
it() block with all of the steps in it, but in the event of failure, it’s hard to tell exactly where the problem is.
I was wondering if switching to Jest might help (I’d like to be able to use Jest for testing instead of Mocha - has anyone looked into how hard it would be to provide a package for that?)
Are there other tools I should use? I can write these complex tests in regular old JS, but I’d like to sit within a testing framework, as it does all the reporting and integrates with CI nicely.
I know that Mocha recommends writing atomic repeatable tests with no external dependencies, so I understand that am breaking that rule, but I need to do this level of testing somehow. Any suggestions are welcome.