mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 19:09:18 +08:00
Adding definition of mocha.throwError, with test to cover it.
See implementation in Mocha's source code here:
c4393c4568/support/browser-entry.js (L98)
This commit is contained in:
@@ -249,3 +249,7 @@ function test_run_withOnComplete() {
|
||||
console.log(failures);
|
||||
});
|
||||
}
|
||||
|
||||
function test_throwError() {
|
||||
mocha.throwError(new Error("I'm an error!"));
|
||||
}
|
||||
|
||||
6
mocha/mocha.d.ts
vendored
6
mocha/mocha.d.ts
vendored
@@ -100,6 +100,12 @@ declare class Mocha {
|
||||
invert(): Mocha;
|
||||
ignoreLeaks(value: boolean): Mocha;
|
||||
checkLeaks(): Mocha;
|
||||
/**
|
||||
* Function to allow assertion libraries to throw errors directly into mocha.
|
||||
* This is useful when running tests in a browser because window.onerror will
|
||||
* only receive the 'message' attribute of the Error.
|
||||
*/
|
||||
throwError(error: Error): void;
|
||||
/** Enables growl support. */
|
||||
growl(): Mocha;
|
||||
globals(value: string): Mocha;
|
||||
|
||||
Reference in New Issue
Block a user