()
| 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() |
no test coverage detected