Skip to content

Execute a subset of tests

Karasu edited this page Jun 14, 2017 · 2 revisions

First please note that all jasmine suites (describe()) have to be wrapped in a main() function in .spec.ts files.

Run a subset of describe (suites)

Prepend an 'f' to each of the describe() you wish to include. All other elements not starting with 'f' will henceforth be ignored when running npm test:

export function main() {
  fdescribe('my suite', () => {
    beforeEach(() => {...});
    it('my spec', () => {...});
  });
}

Run a subset of it (specs)

Prepend an 'f' to each of the it() you wish to include. All other elements not starting with 'f' will henceforth be ignored when running npm test:

export function main() {
  describe('my suite', () => {
    beforeEach(() => {...});
    fit('my spec', () => {...});
  });
}

Exclude a describe (suite)

Prepend an 'x' to each of the describe() you wish to exclude.

export function main() {
  xdescribe('my suite', () => {
    beforeEach(() => {...});
    it('my spec', () => {...});
  });
}

Disable an it (spec)

Prepend an 'x' to each of the it() you wish to exclude.

export function main() {
  describe('my suite', () => {
    beforeEach(() => {...});
    xit('my spec', () => {...});
  });
}