mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[assert] Fix passing RegEx to .throws
This commit is contained in:
parent
a7e0763b93
commit
75d166174f
@ -5,6 +5,7 @@ assert(true, "it's working");
|
||||
assert.ok(true, "inner functions work as well");
|
||||
|
||||
assert.throws(() => {});
|
||||
assert.throws(() => {}, /Regex test/);
|
||||
assert.throws(() => {}, () => {}, "works wonderfully");
|
||||
|
||||
assert['fail'](true, true, "works like a charm");
|
||||
|
||||
5
types/assert/index.d.ts
vendored
5
types/assert/index.d.ts
vendored
@ -1,6 +1,7 @@
|
||||
// Type definitions for commonjs-assert 1.4
|
||||
// Project: https://github.com/browserify/commonjs-assert
|
||||
// Definitions by: Nico Gallinal <https://github.com/nicoabie>
|
||||
// Linus Unnebäck <https://github.com/LinusU>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function assert(value: any, message?: string): void;
|
||||
@ -23,10 +24,10 @@ declare namespace assert {
|
||||
function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
|
||||
function throws(block: () => void, message?: string): void;
|
||||
function throws(block: () => void, error: () => void | ((err: any) => boolean) | RegExp, message?: string): void;
|
||||
function throws(block: () => void, error: (() => void) | ((err: any) => boolean) | RegExp, message?: string): void;
|
||||
|
||||
function doesNotThrow(block: () => void, message?: string): void;
|
||||
function doesNotThrow(block: () => void, error: () => void | ((err: any) => boolean) | RegExp, message?: string): void;
|
||||
function doesNotThrow(block: () => void, error: (() => void) | ((err: any) => boolean) | RegExp, message?: string): void;
|
||||
|
||||
function ifError(value: any): void;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user