Specs and Suite Labels

Specs and suites can be tagged with TestBox labels. Labels allow 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.

describe(title="A spec", labels="stg,railo", body=function() {
     it("executes if its in staging or in railo", function() {
          coldbox = 0;
          coldbox++;

          expect( coldbox ).toBe( 1 );
     });
});

describe("A spec", function() {
     it("is just a closure, so it can contain any code", function() {
          coldbox = 0;
          coldbox++;

          expect( coldbox ).toBe( 1 );
     });

     it(title="can have more than one expectation and labels", labels="dev,stg,qa,shopping", body=function() {
          coldbox = 0;
          coldbox++;

          expect( coldbox ).toBe( 1 );
          expect( coldbox ).toBeTrue();
     });
});

Direct Suite Name Matching

When using the testSuites filter (via a runner, the CLI, or TestBox directly), TestBox performs direct suite name matching at any nesting depth. This means if a suite's name exactly matches the filter value it will always be included — regardless of where it sits in the nesting hierarchy.

Targeting by name from the various runners:

Last updated

Was this helpful?