Skip to content

Focusing Tests

James Adarich edited this page Aug 1, 2019 · 2 revisions

You can run a single test or select tests using the Focus annotation

import { Expect, Test, Focus, TestFixture } from "alsatian";

@TestFixture("Example Test Fixture")
export class ExampleTestFixture {

  @Test()
  @Focus
  public thisTestWillBeRun() {
    Expect(1).toBe(1);
  }

  @Test()
  public thisTestWillNotBeRun() {
    Expect(1).toBe(1);
  }
}

or you can run only tests in this fixture using the Focus annotation

import { Expect, Test, Focus, TestFixture } from "alsatian";

@Focus
@TestFixture("Example Test Fixture")
export class ExampleTestFixture {

  @Test()
  public thisTestWillBeRun() {
    Expect(1).toBe(1);
  }

  @Test()
  public soWillThisTest() {
    Expect(1).toBe(1);
  }
}
Clone this wiki locally