mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 19:43:20 +08:00
committed by
Mohamed Hegazy
parent
5193c7c6ed
commit
b24419795d
4
types/power-assert/index.d.ts
vendored
4
types/power-assert/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for power-assert 1.4.1
|
||||
// Type definitions for power-assert 1.5.0
|
||||
// Project: https://github.com/twada/power-assert
|
||||
// Definitions by: vvakame <https://github.com/vvakame>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -62,6 +62,8 @@ declare namespace assert {
|
||||
|
||||
export function ifError(value:any):void;
|
||||
|
||||
export const strict: typeof assert;
|
||||
|
||||
export interface Options {
|
||||
assertion?: empower.Options;
|
||||
output?: powerAssertFormatter.Options;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
import assert = require("power-assert");
|
||||
|
||||
assert(1 + 1 - 2 === 0, "The universe isn't how it should.");
|
||||
@@ -16,13 +14,13 @@ assert.notDeepStrictEqual([{a:1}], [{a:1}], "uses === comparator");
|
||||
|
||||
assert.throws(() => {
|
||||
throw "a hammer at your face";
|
||||
}, undefined, "DODGED IT");
|
||||
}, "DODGED IT");
|
||||
|
||||
assert.doesNotThrow(() => {
|
||||
if (!!false) {
|
||||
throw "a hammer at your face";
|
||||
}
|
||||
}, undefined, "What the...*crunch*");
|
||||
}, "What the...*crunch*");
|
||||
|
||||
|
||||
var customizedAssert1 = assert.customize({
|
||||
@@ -41,13 +39,13 @@ customizedAssert1.notStrictEqual(2, "2", "uses === comparator");
|
||||
|
||||
customizedAssert1.throws(() => {
|
||||
throw "a hammer at your face";
|
||||
}, undefined, "DODGED IT");
|
||||
}, "DODGED IT");
|
||||
|
||||
customizedAssert1.doesNotThrow(() => {
|
||||
if (!!false) {
|
||||
throw "a hammer at your face";
|
||||
}
|
||||
}, undefined, "What the...*crunch*");
|
||||
}, "What the...*crunch*");
|
||||
|
||||
|
||||
var customizedAssert2 = assert.customize({
|
||||
@@ -85,3 +83,5 @@ var customizedAssert2 = assert.customize({
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
(): typeof assert => assert.strict;
|
||||
|
||||
Reference in New Issue
Block a user