pedro_pmda
pedro_pmda

Reputation: 47

Jump test in Jasmine in a unit

I would like to know if there exists something in Jasmine like @ignore in JUnit. I would like to ignore some tests, but not all.

I'm refering something like this:

@Ignore
describe("Hello world", function() {
  it("says hello", function() {
    expect(helloWorld()).toEqual("Hello world!");
  });
});

Thanks

Upvotes: 1

Views: 77

Answers (2)

Fissio
Fissio

Reputation: 3758

From jasmine docs:

Suites can be disabled with the xdescribe function. These suites and any specs inside them are skipped when run and thus their results will show as pending.

Source: https://jasmine.github.io/2.5/introduction#section-Disabling_Suites

Upvotes: 2

Daniel A. White
Daniel A. White

Reputation: 190925

You can prefix either the describe or it blocks with x and they will be disabled. So in effect you are calling xdescribe or xit.

xdescribe("Hello world", function() {
  it("says hello", function() {
    expect(helloWorld()).toEqual("Hello world!");
  });
});

Upvotes: 3

Related Questions