Thank you for your answer. I will explain what I want. It maybe that the verifySteps is not the same what I need...
I write the test set for my some constructor. This constructor creates and initializes some properties. My tests test each that property. Also I have some array which contains the names of tested properties. My tests add into that array the names of properties which they tested.
After that test set will be done must be launched my special test: it compares the set of properties which was defined by my constructor with the contents of the array which contains the set of tested properties. If all properties was tested then the test passes, otherwise it fails.
Last test allows to me to be sure what I tested all properties. Later if I add new property then this test immediately let me know that I am to add the new test or the set of tests.
- (function(){
- let instanceCheckedProps = [];
- QUnit.test("Node() ctor: check the instance's id property.",
- function (assert) {
- let prop = 'id';
- // here is my test code...
- instanceCheckedProps.push(prop);
- });
- // Here is my other tests...
- QUnit.test('Node() ctor : check if all properties have been tested',
- function (assert) {
- let node = new Tree.Node();
- let allPropsChecked = true;
- let instanceAllProps = Object.keys(node);
- for (let i = 0; i < instanceAllProps.length; i++) {
- if (!instanceCheckedProps.includes(instanceAllProps[i])) {
- allPropsChecked = false;
- break;
- }
- }
- assert.ok(allPropsChecked);
- });
- })();
But I see that QUnit launches my tests not in the same sequence what they was wrote: my special test is launched first.
How can I solve it?