Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Dec 16, 2022
1 parent b302e85 commit 76e6a0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/vitest/src/runtime/error.ts
Expand Up @@ -136,13 +136,13 @@ function isReplaceable(obj1: any, obj2: any) {
return obj1Type === obj2Type && obj1Type === 'Object'
}

export function replaceAsymmetricMatcher(actual: any, expected: any, actualReplaced = new WeakMap(), expectedReplaced = new WeakMap()) {
export function replaceAsymmetricMatcher(actual: any, expected: any, actualReplaced = new WeakSet(), expectedReplaced = new WeakSet()) {
if (!isReplaceable(actual, expected))
return { replacedActual: actual, replacedExpected: expected }
if (actualReplaced.has(actual) || expectedReplaced.has(expected))
return { replacedActual: actual, replacedExpected: expected }
actualReplaced.set(actual, true)
expectedReplaced.set(expected, true)
actualReplaced.add(actual)
expectedReplaced.add(expected)
ChaiUtil.getOwnEnumerableProperties(expected).forEach((key) => {
const expectedValue = expected[key]
const actualValue = actual[key]
Expand Down
4 changes: 0 additions & 4 deletions packages/vitest/src/utils/base.ts
Expand Up @@ -37,10 +37,6 @@ export function slash(str: string) {
return str.replace(/\\/g, '/')
}

export function mergeSlashes(str: string) {
return str.replace(/\/\//g, '/')
}

export const noop = () => { }

export function getType(value: unknown): string {
Expand Down

0 comments on commit 76e6a0f

Please sign in to comment.