From 7a282c9146cbd09ecfa6c1a3f60394ec5e6c0925 Mon Sep 17 00:00:00 2001 From: TomokiMiyauci Date: Tue, 30 Nov 2021 22:15:01 +0900 Subject: [PATCH] feat(matcher): use custom equal function --- matcher/to_contain_entry.ts | 2 +- matcher/to_contain_equal.ts | 3 ++- matcher/to_equal.ts | 2 +- matcher/to_have_been_last_called_with.ts | 2 +- matcher/to_have_been_nth_called_with.ts | 2 +- matcher/to_have_last_returned_with.ts | 2 +- matcher/to_have_nth_returned_with.ts | 3 ++- matcher/to_have_returned_with.ts | 2 +- matcher/to_include_same_members.ts | 2 +- matcher/utils.ts | 3 ++- 10 files changed, 13 insertions(+), 10 deletions(-) diff --git a/matcher/to_contain_entry.ts b/matcher/to_contain_entry.ts index cf4a0d9..2a44990 100644 --- a/matcher/to_contain_entry.ts +++ b/matcher/to_contain_entry.ts @@ -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( diff --git a/matcher/to_contain_equal.ts b/matcher/to_contain_equal.ts index da86f37..9979d46 100644 --- a/matcher/to_contain_equal.ts +++ b/matcher/to_contain_equal.ts @@ -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( diff --git a/matcher/to_equal.ts b/matcher/to_equal.ts index 847bd1c..de83168 100644 --- a/matcher/to_equal.ts +++ b/matcher/to_equal.ts @@ -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 { diff --git a/matcher/to_have_been_last_called_with.ts b/matcher/to_have_been_last_called_with.ts index 2cb3e89..c1eacfc 100644 --- a/matcher/to_have_been_last_called_with.ts +++ b/matcher/to_have_been_last_called_with.ts @@ -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"], diff --git a/matcher/to_have_been_nth_called_with.ts b/matcher/to_have_been_nth_called_with.ts index 84446f4..c83b27f 100644 --- a/matcher/to_have_been_nth_called_with.ts +++ b/matcher/to_have_been_nth_called_with.ts @@ -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"], diff --git a/matcher/to_have_last_returned_with.ts b/matcher/to_have_last_returned_with.ts index a38ed8f..6f80f94 100644 --- a/matcher/to_have_last_returned_with.ts +++ b/matcher/to_have_last_returned_with.ts @@ -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"; diff --git a/matcher/to_have_nth_returned_with.ts b/matcher/to_have_nth_returned_with.ts index 01571f7..3235728 100644 --- a/matcher/to_have_nth_returned_with.ts +++ b/matcher/to_have_nth_returned_with.ts @@ -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[], diff --git a/matcher/to_have_returned_with.ts b/matcher/to_have_returned_with.ts index 1fbc8c6..083fb13 100644 --- a/matcher/to_have_returned_with.ts +++ b/matcher/to_have_returned_with.ts @@ -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"; diff --git a/matcher/to_include_same_members.ts b/matcher/to_include_same_members.ts index 200c04e..6150857 100644 --- a/matcher/to_include_same_members.ts +++ b/matcher/to_include_same_members.ts @@ -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( diff --git a/matcher/utils.ts b/matcher/utils.ts index ea689a2..66e02c6 100644 --- a/matcher/utils.ts +++ b/matcher/utils.ts @@ -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( howMany: number,