MCPcopy
hub / github.com/vitest-dev/vitest / validateAssertion

Function validateAssertion

packages/vitest/src/integrations/snapshot/chai.ts:72–76  ·  view source on GitHub ↗
(assertion: Chai.Assertion)

Source from the content-addressed store, hash-verified

70}
71
72function validateAssertion(assertion: Chai.Assertion): void {
73 if (chai.util.flag(assertion, 'negate')) {
74 throw new Error(`${getAssertionName(assertion)} cannot be used with "not"`)
75 }
76}
77
78export const SnapshotPlugin: ChaiPlugin = (chai, utils) => {
79 for (const key of ['matchSnapshot', 'toMatchSnapshot']) {

Callers 4

SnapshotPluginFunction · 0.85
toMatchSnapshotImplFunction · 0.85
toMatchFileSnapshotImplFunction · 0.85

Calls 1

getAssertionNameFunction · 0.85

Tested by

no test coverage detected