Skip to content

Commit

Permalink
feat(matcher): use custom equal function
Browse files Browse the repository at this point in the history
  • Loading branch information
TomokiMiyauci committed Nov 30, 2021
1 parent d9b495b commit 7a282c9
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion matcher/to_contain_entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This module is browser compatible.

import { has, prop } from "./utils.ts";
import { equal } from "../deps.ts";
import { equal } from "../helper/equal.ts";
import type { MatchResult } from "./types.ts";

function predict(
Expand Down
3 changes: 2 additions & 1 deletion matcher/to_contain_equal.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright 2021-Present the Unitest authors. All rights reserved. MIT license.
// This module is browser compatible.

import { equal, isObject } from "../deps.ts";
import { isObject } from "../deps.ts";
import { equal } from "../helper/equal.ts";
import type { MatchResult } from "./types.ts";

function predict(
Expand Down
2 changes: 1 addition & 1 deletion matcher/to_equal.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2021-Present the Unitest authors. All rights reserved. MIT license.
// This module is browser compatible.
import { equal } from "../deps.ts";
import { equal } from "../helper/equal.ts";
import { MatchResult } from "./types.ts";

function toEqual(actual: unknown, expected: unknown): MatchResult {
Expand Down
2 changes: 1 addition & 1 deletion matcher/to_have_been_last_called_with.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This module is browser compatible.
import type { Mock, MockCall } from "../mock/types.ts";
import type { MatchResult } from "./types.ts";
import { equal } from "../deps.ts";
import { equal } from "../helper/equal.ts";

function predict(
calls: MockCall["calls"],
Expand Down
2 changes: 1 addition & 1 deletion matcher/to_have_been_nth_called_with.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This module is browser compatible.
import type { Mock, MockCall } from "../mock/types.ts";
import type { MatchResult } from "./types.ts";
import { equal } from "../deps.ts";
import { equal } from "../helper/equal.ts";

function predict(
calls: MockCall["calls"],
Expand Down
2 changes: 1 addition & 1 deletion matcher/to_have_last_returned_with.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2021-Present the Unitest authors. All rights reserved. MIT license.
// This module is browser compatible.
import { equal } from "../deps.ts";
import { equal } from "../helper/equal.ts";
import type { MatchResult } from "./types.ts";
import { takeLast } from "./utils.ts";
import type { Mock, MockResult } from "../mock/types.ts";
Expand Down
3 changes: 2 additions & 1 deletion matcher/to_have_nth_returned_with.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// This module is browser compatible.
import type { MatchResult } from "./types.ts";
import type { Mock, MockResult } from "../mock/types.ts";
import { equal, isUndefined } from "../deps.ts";
import { isUndefined } from "../deps.ts";
import { equal } from "../helper/equal.ts";

function predict(
mockResults: MockResult[],
Expand Down
2 changes: 1 addition & 1 deletion matcher/to_have_returned_with.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2021-Present the Unitest authors. All rights reserved. MIT license.
// This module is browser compatible.
import { equal } from "../deps.ts";
import { equal } from "../helper/equal.ts";
import type { MatchResult } from "./types.ts";
import type { Mock, MockResult } from "../mock/types.ts";

Expand Down
2 changes: 1 addition & 1 deletion matcher/to_include_same_members.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2021-Present the Unitest authors. All rights reserved. MIT license.
// This module is browser compatible.

import { equal } from "../deps.ts";
import { equal } from "../helper/equal.ts";
import type { MatchResult } from "./types.ts";

function predict(
Expand Down
3 changes: 2 additions & 1 deletion matcher/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright 2021-Present the Unitest authors. All rights reserved. MIT license.
// This module is browser compatible.

import { equal, isLength0, isObject, isUndefined } from "../deps.ts";
import { isLength0, isObject, isUndefined } from "../deps.ts";
import { equal } from "../helper/equal.ts";

function takeLast<T extends readonly unknown[] | string>(
howMany: number,
Expand Down

0 comments on commit 7a282c9

Please sign in to comment.