Specs and Suite Labels
Specs and suites can be tagged with TestBox labels. Labels allows you to further categorize different specs or suites so that when a runner executes with labels attached, only those specs and suites will be executed, the rest will be skipped. You can alternatively choose to skip specific labels when a runner executes with excludes attached.
1
describe(title="A spec", labels="stg,railo", body=function() {
2
it("executes if its in staging or in railo", function() {
3
coldbox = 0;
4
coldbox++;
5
6
expect( coldbox ).toBe( 1 );
7
});
8
});
9
10
describe("A spec", function() {
11
it("is just a closure, so it can contain any code", function() {
12
coldbox = 0;
13
coldbox++;
14
15
expect( coldbox ).toBe( 1 );
16
});
17
18
it(title="can have more than one expectation and labels", labels="dev,stg,qa,shopping", body=function() {
19
coldbox = 0;
20
coldbox++;
21
22
expect( coldbox ).toBe( 1 );
23
expect( coldbox ).toBeTrue();
24
});
25
});
Copied!
Copy link
Edit on GitHub