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

Function matches

packages/browser/src/client/tester/expect/utils.ts:282–289  ·  view source on GitHub ↗
(textToMatch: string, matcher: string | RegExp)

Source from the content-addressed store, hash-verified

280}
281
282export function matches(textToMatch: string, matcher: string | RegExp): boolean {
283 if (matcher instanceof RegExp) {
284 return matcher.test(textToMatch)
285 }
286 else {
287 return textToMatch.includes(String(matcher))
288 }
289}
290
291export function arrayAsSetComparison(a: unknown, b: unknown): boolean | undefined {
292 if (Array.isArray(a) && Array.isArray(b)) {

Callers 1

toHaveTextContentFunction · 0.90

Calls 1

testMethod · 0.45

Tested by

no test coverage detected