From b24419795db48447632332332ccebbd085ba4fcb Mon Sep 17 00:00:00 2001 From: falsandtru Date: Wed, 11 Apr 2018 02:16:16 +0900 Subject: [PATCH] power-assert: Update APIs (#24578) * Update APIs * Update header --- types/power-assert/index.d.ts | 4 +++- types/power-assert/power-assert-tests.ts | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/types/power-assert/index.d.ts b/types/power-assert/index.d.ts index fa23620b8e..ab066b28bc 100644 --- a/types/power-assert/index.d.ts +++ b/types/power-assert/index.d.ts @@ -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 // 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; diff --git a/types/power-assert/power-assert-tests.ts b/types/power-assert/power-assert-tests.ts index 0ec099b32c..a60f99964d 100644 --- a/types/power-assert/power-assert-tests.ts +++ b/types/power-assert/power-assert-tests.ts @@ -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;