@vitest/expect
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -1,15 +0,13 @@ | ||
import * as _vitest_utils from '@vitest/utils'; | ||
import * as tinyrainbow from 'tinyrainbow'; | ||
import { Formatter } from 'tinyrainbow'; | ||
import { stringify, Constructable } from '@vitest/utils'; | ||
export { setupColors } from '@vitest/utils'; | ||
import { diff } from '@vitest/utils/diff'; | ||
export { DiffOptions } from '@vitest/utils/diff'; | ||
type Formatter = (input: string | number | null | undefined) => string; | ||
declare function getMatcherUtils(): { | ||
EXPECTED_COLOR: _vitest_utils.ColorMethod; | ||
RECEIVED_COLOR: _vitest_utils.ColorMethod; | ||
INVERTED_COLOR: _vitest_utils.ColorMethod; | ||
BOLD_WEIGHT: _vitest_utils.ColorMethod; | ||
DIM_COLOR: _vitest_utils.ColorMethod; | ||
EXPECTED_COLOR: tinyrainbow.Formatter; | ||
RECEIVED_COLOR: tinyrainbow.Formatter; | ||
INVERTED_COLOR: tinyrainbow.Formatter; | ||
BOLD_WEIGHT: tinyrainbow.Formatter; | ||
DIM_COLOR: tinyrainbow.Formatter; | ||
matcherHint: (matcherName: string, received?: string, expected?: string, options?: MatcherHintOptions) => string; | ||
@@ -16,0 +14,0 @@ printReceived: (object: unknown) => string; |
@@ -1,3 +0,3 @@ | ||
import { getType, getColors, stringify, isObject, assertTypes } from '@vitest/utils'; | ||
export { setupColors } from '@vitest/utils'; | ||
import { getType, stringify, isObject, assertTypes } from '@vitest/utils'; | ||
import c from 'tinyrainbow'; | ||
import { diff } from '@vitest/utils/diff'; | ||
@@ -46,8 +46,7 @@ import { isMockFunction } from '@vitest/spy'; | ||
function getMatcherUtils() { | ||
const c = () => getColors(); | ||
const EXPECTED_COLOR = c().green; | ||
const RECEIVED_COLOR = c().red; | ||
const INVERTED_COLOR = c().inverse; | ||
const BOLD_WEIGHT = c().bold; | ||
const DIM_COLOR = c().dim; | ||
const EXPECTED_COLOR = c.green; | ||
const RECEIVED_COLOR = c.red; | ||
const INVERTED_COLOR = c.inverse; | ||
const BOLD_WEIGHT = c.bold; | ||
const DIM_COLOR = c.dim; | ||
function matcherHint(matcherName, received = "received", expected = "expected", options = {}) { | ||
@@ -933,3 +932,2 @@ const { | ||
const { AssertionError } = chai; | ||
const c = () => getColors(); | ||
const customTesters = getCustomEqualityTesters(); | ||
@@ -1342,3 +1340,3 @@ function def(name, fn) { | ||
if (spy.mock.calls) { | ||
msg += c().gray( | ||
msg += c.gray( | ||
` | ||
@@ -1349,3 +1347,3 @@ | ||
${spy.mock.calls.map((callArg, i) => { | ||
let methodCall = c().bold( | ||
let methodCall = c.bold( | ||
` ${ordinalOf(i + 1)} ${spy.getMockName()} call: | ||
@@ -1367,6 +1365,6 @@ | ||
} | ||
msg += c().gray( | ||
msg += c.gray( | ||
` | ||
Number of calls: ${c().bold(spy.mock.calls.length)} | ||
Number of calls: ${c.bold(spy.mock.calls.length)} | ||
` | ||
@@ -1377,3 +1375,3 @@ ); | ||
const formatReturns = (spy, results, msg, showActualReturn) => { | ||
msg += c().gray( | ||
msg += c.gray( | ||
` | ||
@@ -1384,3 +1382,3 @@ | ||
${results.map((callReturn, i) => { | ||
let methodCall = c().bold( | ||
let methodCall = c.bold( | ||
` ${ordinalOf(i + 1)} ${spy.getMockName()} call return: | ||
@@ -1401,6 +1399,6 @@ | ||
); | ||
msg += c().gray( | ||
msg += c.gray( | ||
` | ||
Number of calls: ${c().bold(spy.mock.calls.length)} | ||
Number of calls: ${c.bold(spy.mock.calls.length)} | ||
` | ||
@@ -1407,0 +1405,0 @@ ); |
{ | ||
"name": "@vitest/expect", | ||
"type": "module", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Jest's expect matchers as a Chai plugin", | ||
@@ -34,10 +34,10 @@ "license": "MIT", | ||
"chai": "^5.1.1", | ||
"@vitest/spy": "2.0.1", | ||
"@vitest/utils": "2.0.1" | ||
"tinyrainbow": "^1.2.0", | ||
"@vitest/spy": "2.0.2", | ||
"@vitest/utils": "2.0.2" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "4.3.6", | ||
"picocolors": "^1.0.1", | ||
"rollup-plugin-copy": "^3.5.0", | ||
"@vitest/runner": "2.0.1" | ||
"@vitest/runner": "2.0.2" | ||
}, | ||
@@ -44,0 +44,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3
148668
4
2209
+ Addedtinyrainbow@^1.2.0
+ Added@vitest/pretty-format@2.0.2(transitive)
+ Added@vitest/spy@2.0.2(transitive)
+ Added@vitest/utils@2.0.2(transitive)
+ Addedtinyrainbow@1.2.0(transitive)
- Removed@jest/schemas@29.6.3(transitive)
- Removed@sinclair/typebox@0.27.8(transitive)
- Removed@vitest/spy@2.0.1(transitive)
- Removed@vitest/utils@2.0.1(transitive)
- Removedansi-styles@5.2.0(transitive)
- Removeddiff-sequences@29.6.3(transitive)
- Removedpretty-format@29.7.0(transitive)
- Removedreact-is@18.3.1(transitive)
Updated@vitest/spy@2.0.2
Updated@vitest/utils@2.0.2