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

Method getException

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

Source from the content-addressed store, hash-verified

19 }
20
21 getException() {
22 const params = this.params
23 params.jar = template(params.jar, params)
24 const err = new AssertionFailedError(params, '{{customMessage}}expected {{jar}} {{type}} "{{needle}}"')
25 err.expected = params.needle
26 err.actual = params.haystack
27 if (Array.isArray(this.params.haystack)) {
28 this.params.haystack = this.params.haystack.join('\n___(next element)___\n')
29 }
30 err.cliMessage = function () {
31 const msg = this.template.replace('{{jar}}', output.colors.bold('{{jar}}')).replace('{{needle}}', output.colors.bold('{{needle}}'))
32 return template(msg, this.params)
33 }
34 return err
35 }
36
37 getFailedAssertion() {
38 const err = this.getException()

Callers 2

getFailedAssertionMethod · 0.95
getFailedNegationMethod · 0.95

Calls 1

templateFunction · 0.90

Tested by

no test coverage detected