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:
Eric Freese 2018-11-14 00:20:14 -07:00
parent a8ef194960
commit 46b0ea8eb9
2 changed files with 3 additions and 2 deletions

View File

@ -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 });

View File

@ -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. */