Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions types/mocha/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@ declare class Mocha {
*/
delay(): boolean;

/**
* Fails test run if no tests encountered with exit-code 1.
*
* @see https://mochajs.org/api/mocha#failZero
*/
failZero(failZero?: boolean): this;

/**
* Tests marked only fail the suite
*
Expand Down Expand Up @@ -2313,6 +2320,9 @@ declare namespace Mocha {
/** Report tests without running them? */
dryRun?: boolean | undefined;

/** Fail test run if zero tests encountered. */
failZero?: boolean | undefined;

/** Test filter given string. */
fgrep?: string | undefined;

Expand Down
7 changes: 7 additions & 0 deletions types/mocha/mocha-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,7 @@ function test_constructor_all_options() {
delay: true,
diff: true,
dryRun: true,
failZero: true,
fgrep: "test",
forbidOnly: true,
forbidPending: true,
Expand Down Expand Up @@ -950,6 +951,12 @@ function test_constructor_all_options() {
});
}

function test_instance_methods() {
let m: Mocha = new LocalMocha();

m = m.failZero(true);
}

function test_run(localMocha: LocalMocha) {
// $ExpectType Runner
mocha.run();
Expand Down