Skip to content

Commit

Permalink
fix(DeepEqualAssertion): allow Actual to extend Expected rather requi…
Browse files Browse the repository at this point in the history
…ring that it must be the other way around

fix #2964
  • Loading branch information
RebeccaStevens committed Feb 14, 2022
1 parent 576f534 commit 8a794e8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions types/assertions.d.ts
Expand Up @@ -137,6 +137,12 @@ export interface DeepEqualAssertion {
* `expected`, returning a boolean indicating whether the assertion passed.
*/
<Actual, Expected extends Actual>(actual: Actual, expected: Expected, message?: string): actual is Expected;

/**
* Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to
* `expected`, returning a boolean indicating whether the assertion passed.
*/
<Actual extends Expected, Expected>(actual: Actual, expected: Expected, message?: string): expected is Actual;

/** Skip this assertion. */
skip(actual: any, expected: any, message?: string): void;
Expand Down

0 comments on commit 8a794e8

Please sign in to comment.