mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Fix equal function when passing in an array
For example, `expect([1, 2, 3]).to.equal([1, 2, 3])` previously would give the compilation error: > Argument of type 'number[]' is not assignable to parameter of type 'number'.
This commit is contained in:
parent
a8ef194960
commit
46b0ea8eb9
@ -103,6 +103,7 @@ expect("abcd").to.have.length(4);
|
||||
|
||||
expect(5).to.equal(5);
|
||||
expect({ a: 1 }).to.equal({ a: 1 });
|
||||
expect([1, 2, 3]).to.equal([1, 2, 3]);
|
||||
|
||||
expect(Object.create(null)).to.equal({}, { prototype: false });
|
||||
|
||||
|
||||
4
types/code/index.d.ts
vendored
4
types/code/index.d.ts
vendored
@ -125,9 +125,9 @@ export interface Values<T> {
|
||||
/** Asserts that the reference value has a length property matching the provided size or an object with the specified number of keys. */
|
||||
length(size: number): AssertionChain<T>;
|
||||
/** Asserts that the reference value equals the provided value. */
|
||||
equal(value: T, options?: any): AssertionChain<T>;
|
||||
equal(value: T | T[], options?: any): AssertionChain<T>;
|
||||
/** Asserts that the reference value equals the provided value. */
|
||||
equals(value: T, options?: any): AssertionChain<T>;
|
||||
equals(value: T | T[], options?: any): AssertionChain<T>;
|
||||
/** Asserts that the reference value is greater than (>) the provided value. */
|
||||
above(value: T): AssertionChain<T>;
|
||||
/** Asserts that the reference value is greater than (>) the provided value. */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user