MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / getFailedNegation

Method getFailedNegation

lib/assert/include.js:47–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45 }
46
47 getFailedNegation() {
48 this.params.type = 'not to include'
49 const err = this.getException()
50 const pattern = new RegExp(`^.*?\n?^.*?\n?^.*?${escapeRegExp(this.params.needle)}.*?$\n?.*$\n?.*$`, 'm')
51 const matched = this.params.haystack.match(pattern)
52 if (!matched) return err
53 err.actual = matched[0].replace(this.params.needle, output.colors.bold(this.params.needle))
54 err.actual = `------\n${err.actual}\n------`
55 return err
56 }
57
58 addAssertParams() {
59 this.params.needle = arguments[0]

Callers

nothing calls this directly

Calls 2

getExceptionMethod · 0.95
escapeRegExpFunction · 0.85

Tested by

no test coverage detected