assertron 10.0.1 → 10.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/cjs/assert-order/AssertOrder.d.ts +1 -1
- package/cjs/assert-order/AssertOrder.d.ts.map +1 -1
- package/cjs/assert-order/AssertOrder.js +103 -176
- package/cjs/assert-order/AssertOrder.js.map +1 -1
- package/cjs/assert-order/InvalidOrder.d.ts +1 -1
- package/cjs/assert-order/InvalidOrder.d.ts.map +1 -1
- package/cjs/assert-order/InvalidOrder.js +18 -34
- package/cjs/assert-order/InvalidOrder.js.map +1 -1
- package/cjs/assert-order/StateMachine.d.ts +1 -1
- package/cjs/assert-order/StateMachine.d.ts.map +1 -1
- package/cjs/assert-order/StateMachine.js +102 -125
- package/cjs/assert-order/StateMachine.js.map +1 -1
- package/cjs/assert-order/types.d.ts.map +1 -1
- package/cjs/assertron/assertron.d.ts +20 -19
- package/cjs/assertron/assertron.d.ts.map +1 -1
- package/cjs/assertron/assertron.js +22 -13
- package/cjs/assertron/assertron.js.map +1 -1
- package/cjs/assertron/falsy.d.ts +1 -1
- package/cjs/assertron/falsy.d.ts.map +1 -1
- package/cjs/assertron/falsy.js +2 -2
- package/cjs/assertron/falsy.js.map +1 -1
- package/cjs/assertron/index.d.ts +1 -0
- package/cjs/assertron/index.d.ts.map +1 -1
- package/cjs/assertron/isInstanceof.d.ts +3 -0
- package/cjs/assertron/isInstanceof.d.ts.map +1 -0
- package/cjs/assertron/isInstanceof.js +11 -0
- package/cjs/assertron/isInstanceof.js.map +1 -0
- package/cjs/assertron/pathEqual.d.ts.map +1 -1
- package/cjs/assertron/pathEqual.js +3 -3
- package/cjs/assertron/pathEqual.js.map +1 -1
- package/cjs/assertron/rejects.d.ts +1 -1
- package/cjs/assertron/rejects.d.ts.map +1 -1
- package/cjs/assertron/rejects.js +5 -3
- package/cjs/assertron/rejects.js.map +1 -1
- package/cjs/assertron/repeat.d.ts.map +1 -1
- package/cjs/assertron/repeat.js +6 -4
- package/cjs/assertron/repeat.js.map +1 -1
- package/cjs/assertron/resolves.d.ts.map +1 -1
- package/cjs/assertron/resolves.js +5 -3
- package/cjs/assertron/resolves.js.map +1 -1
- package/cjs/assertron/satisfies.d.ts +4 -3
- package/cjs/assertron/satisfies.d.ts.map +1 -1
- package/cjs/assertron/satisfies.js +6 -5
- package/cjs/assertron/satisfies.js.map +1 -1
- package/cjs/assertron/throws.d.ts +1 -1
- package/cjs/assertron/throws.d.ts.map +1 -1
- package/cjs/assertron/throws.js +15 -11
- package/cjs/assertron/throws.js.map +1 -1
- package/cjs/assertron/truthy.d.ts +1 -1
- package/cjs/assertron/truthy.d.ts.map +1 -1
- package/cjs/assertron/truthy.js +2 -2
- package/cjs/assertron/truthy.js.map +1 -1
- package/cjs/errors.d.ts +3 -3
- package/cjs/errors.d.ts.map +1 -1
- package/cjs/errors.js +12 -32
- package/cjs/errors.js.map +1 -1
- package/cjs/index.d.ts +2 -1
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +16 -2
- package/cjs/index.js.map +1 -1
- package/cjs/package.json +1 -1
- package/cjs/types.d.ts +2 -2
- package/cjs/types.d.ts.map +1 -1
- package/cjs/utils/index.js +2 -2
- package/cjs/utils/index.js.map +1 -1
- package/cjs/utils/isErrorConstructor.d.ts +1 -1
- package/cjs/utils/isErrorConstructor.d.ts.map +1 -1
- package/cjs/utils/isErrorConstructor.js.map +1 -1
- package/cjs/utils/notEqualMessage.js +1 -1
- package/cjs/utils/notEqualMessage.js.map +1 -1
- package/cjs/utils/notSatisfiedMessage.d.ts +1 -1
- package/cjs/utils/notSatisfiedMessage.d.ts.map +1 -1
- package/cjs/utils/notSatisfiedMessage.js +12 -16
- package/cjs/utils/notSatisfiedMessage.js.map +1 -1
- package/cjs/utils/notThrownMessage.js +2 -2
- package/cjs/utils/notThrownMessage.js.map +1 -1
- package/cjs/utils/promiseMessages.d.ts.map +1 -1
- package/cjs/utils/promiseMessages.js +9 -5
- package/cjs/utils/promiseMessages.js.map +1 -1
- package/cjs/utils/unexpectedErrorMessage.d.ts +1 -1
- package/cjs/utils/unexpectedErrorMessage.d.ts.map +1 -1
- package/cjs/utils/unexpectedErrorMessage.js +3 -4
- package/cjs/utils/unexpectedErrorMessage.js.map +1 -1
- package/esm/assert-order/AssertOrder.d.ts +1 -1
- package/esm/assert-order/AssertOrder.d.ts.map +1 -1
- package/esm/assert-order/AssertOrder.js +12 -8
- package/esm/assert-order/AssertOrder.js.map +1 -1
- package/esm/assert-order/InvalidOrder.d.ts +1 -1
- package/esm/assert-order/InvalidOrder.d.ts.map +1 -1
- package/esm/assert-order/InvalidOrder.js +4 -2
- package/esm/assert-order/InvalidOrder.js.map +1 -1
- package/esm/assert-order/StateMachine.d.ts +1 -1
- package/esm/assert-order/StateMachine.d.ts.map +1 -1
- package/esm/assert-order/StateMachine.js +20 -10
- package/esm/assert-order/StateMachine.js.map +1 -1
- package/esm/assert-order/types.d.ts.map +1 -1
- package/esm/assertron/assertron.d.ts +20 -19
- package/esm/assertron/assertron.d.ts.map +1 -1
- package/esm/assertron/assertron.js +10 -1
- package/esm/assertron/assertron.js.map +1 -1
- package/esm/assertron/falsy.d.ts +1 -1
- package/esm/assertron/falsy.d.ts.map +1 -1
- package/esm/assertron/falsy.js.map +1 -1
- package/esm/assertron/index.d.ts +1 -0
- package/esm/assertron/index.d.ts.map +1 -1
- package/esm/assertron/isInstanceof.d.ts +3 -0
- package/esm/assertron/isInstanceof.d.ts.map +1 -0
- package/esm/assertron/isInstanceof.js +7 -0
- package/esm/assertron/isInstanceof.js.map +1 -0
- package/esm/assertron/pathEqual.d.ts.map +1 -1
- package/esm/assertron/pathEqual.js.map +1 -1
- package/esm/assertron/rejects.d.ts +1 -1
- package/esm/assertron/rejects.d.ts.map +1 -1
- package/esm/assertron/rejects.js +3 -1
- package/esm/assertron/rejects.js.map +1 -1
- package/esm/assertron/repeat.d.ts.map +1 -1
- package/esm/assertron/repeat.js +3 -1
- package/esm/assertron/repeat.js.map +1 -1
- package/esm/assertron/resolves.d.ts.map +1 -1
- package/esm/assertron/resolves.js +3 -1
- package/esm/assertron/resolves.js.map +1 -1
- package/esm/assertron/satisfies.d.ts +4 -3
- package/esm/assertron/satisfies.d.ts.map +1 -1
- package/esm/assertron/satisfies.js +2 -1
- package/esm/assertron/satisfies.js.map +1 -1
- package/esm/assertron/throws.d.ts +1 -1
- package/esm/assertron/throws.d.ts.map +1 -1
- package/esm/assertron/throws.js +7 -3
- package/esm/assertron/throws.js.map +1 -1
- package/esm/assertron/truthy.d.ts +1 -1
- package/esm/assertron/truthy.d.ts.map +1 -1
- package/esm/assertron/truthy.js.map +1 -1
- package/esm/errors.d.ts +3 -3
- package/esm/errors.d.ts.map +1 -1
- package/esm/errors.js.map +1 -1
- package/esm/index.d.ts +2 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -1
- package/esm/index.js.map +1 -1
- package/esm/types.d.ts +2 -2
- package/esm/types.d.ts.map +1 -1
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/isErrorConstructor.d.ts +1 -1
- package/esm/utils/isErrorConstructor.d.ts.map +1 -1
- package/esm/utils/isErrorConstructor.js.map +1 -1
- package/esm/utils/notEqualMessage.js.map +1 -1
- package/esm/utils/notSatisfiedMessage.d.ts +1 -1
- package/esm/utils/notSatisfiedMessage.d.ts.map +1 -1
- package/esm/utils/notSatisfiedMessage.js +8 -3
- package/esm/utils/notSatisfiedMessage.js.map +1 -1
- package/esm/utils/notThrownMessage.js.map +1 -1
- package/esm/utils/promiseMessages.d.ts.map +1 -1
- package/esm/utils/promiseMessages.js +8 -4
- package/esm/utils/promiseMessages.js.map +1 -1
- package/esm/utils/unexpectedErrorMessage.d.ts +1 -1
- package/esm/utils/unexpectedErrorMessage.d.ts.map +1 -1
- package/esm/utils/unexpectedErrorMessage.js +1 -2
- package/esm/utils/unexpectedErrorMessage.js.map +1 -1
- package/package.json +46 -42
- package/ts/assert-order/AssertOrder.ts +139 -143
- package/ts/assert-order/InvalidOrder.ts +23 -19
- package/ts/assert-order/StateMachine.ts +97 -89
- package/ts/assert-order/index.ts +0 -1
- package/ts/assert-order/internalInterfaces.ts +3 -3
- package/ts/assert-order/types.ts +5 -5
- package/ts/assertron/assertron.ts +56 -18
- package/ts/assertron/falsy.ts +2 -3
- package/ts/assertron/index.ts +1 -0
- package/ts/assertron/isInstanceof.ts +11 -0
- package/ts/assertron/pathEqual.ts +3 -3
- package/ts/assertron/rejects.ts +7 -5
- package/ts/assertron/repeat.ts +27 -21
- package/ts/assertron/resolves.ts +7 -5
- package/ts/assertron/satisfies.ts +30 -22
- package/ts/assertron/throws.ts +76 -55
- package/ts/assertron/truthy.ts +2 -5
- package/ts/errors.ts +9 -9
- package/ts/index.ts +17 -1
- package/ts/testUtils.ts +52 -55
- package/ts/types.ts +0 -1
- package/ts/utils/index.ts +1 -1
- package/ts/utils/isErrorConstructor.ts +2 -2
- package/ts/utils/notEqualMessage.ts +1 -1
- package/ts/utils/notSatisfiedMessage.ts +18 -14
- package/ts/utils/notThrownMessage.ts +1 -1
- package/ts/utils/promiseMessages.ts +12 -5
- package/ts/utils/unexpectedErrorMessage.ts +4 -3
package/ts/assertron/truthy.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { AssertionError } from '../errors.js'
|
|
2
2
|
|
|
3
|
-
export function truthy(value:
|
|
4
|
-
|
|
5
|
-
`Expected value to be truthy, but received ${value}`,
|
|
6
|
-
{ ssf: truthy }
|
|
7
|
-
)
|
|
3
|
+
export function truthy(value: unknown): void {
|
|
4
|
+
if (!value) throw new AssertionError(`Expected value to be truthy, but received ${value}`, { ssf: truthy })
|
|
8
5
|
}
|
package/ts/errors.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RequiredPick } from 'type-plus'
|
|
1
|
+
import { ModuleError } from 'iso-error'
|
|
2
|
+
import type { RequiredPick } from 'type-plus'
|
|
3
3
|
import { failOnOccurrence } from './utils/index.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* A base error for all assertion errors
|
|
7
7
|
*/
|
|
8
8
|
export class AssertionError extends ModuleError {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
constructor(message: string, options: AssertionError.Options) {
|
|
10
|
+
super('assertron', message, options)
|
|
11
|
+
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export namespace AssertionError {
|
|
15
|
-
|
|
15
|
+
export type Options = RequiredPick<ModuleError.Options, 'ssf'>
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export class FailOnOccurrence extends AssertionError {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
constructor(public occurrence: number, public error: any, options: AssertionError.Options) {
|
|
20
|
+
super(failOnOccurrence(occurrence, error), options)
|
|
21
|
+
}
|
|
22
22
|
}
|
package/ts/index.ts
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import { assertron } from './assertron/index.js'
|
|
2
2
|
|
|
3
|
+
export {
|
|
4
|
+
anything,
|
|
5
|
+
has,
|
|
6
|
+
every,
|
|
7
|
+
hasAll,
|
|
8
|
+
isInClosedInterval,
|
|
9
|
+
isInLeftClosedInterval,
|
|
10
|
+
isInOpenInterval,
|
|
11
|
+
isInRange,
|
|
12
|
+
isInRightClosedInterval,
|
|
13
|
+
isTypeOf,
|
|
14
|
+
none,
|
|
15
|
+
some,
|
|
16
|
+
startsWith
|
|
17
|
+
} from 'satisfier'
|
|
3
18
|
export * from './assert-order/index.js'
|
|
4
19
|
export * from './assertron/index.js'
|
|
5
20
|
export * from './errors.js'
|
|
6
|
-
export default assertron
|
|
7
21
|
export { assertron as a }
|
|
22
|
+
|
|
23
|
+
export default assertron
|
package/ts/testUtils.ts
CHANGED
|
@@ -2,83 +2,80 @@
|
|
|
2
2
|
import t from 'assert'
|
|
3
3
|
import isPromise from 'is-promise'
|
|
4
4
|
import { escapeRegExp, isError } from 'lodash'
|
|
5
|
-
import { ErrorConstructor } from './types.js'
|
|
5
|
+
import type { ErrorConstructor } from './types.js'
|
|
6
6
|
|
|
7
7
|
export type AnyFunction = (...args: any[]) => any
|
|
8
8
|
|
|
9
9
|
export function runAsync(fn: AnyFunction) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
try {
|
|
13
|
+
resolve(fn())
|
|
14
|
+
} catch (err) {
|
|
15
|
+
reject(err)
|
|
16
|
+
}
|
|
17
|
+
}, 1)
|
|
18
|
+
})
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
export function runSequentialAsync(...fns: AnyFunction[]) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
})
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
try {
|
|
25
|
+
let i = 0
|
|
26
|
+
for (; i < fns.length - 1; i++) {
|
|
27
|
+
fns[i]()
|
|
28
|
+
}
|
|
29
|
+
resolve(fns[i]())
|
|
30
|
+
} catch (err) {
|
|
31
|
+
reject(err)
|
|
32
|
+
}
|
|
33
|
+
}, 1)
|
|
34
|
+
})
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
export function runParallelAsync(...fns: AnyFunction[]) {
|
|
40
|
-
|
|
38
|
+
return Promise.all(fns.map(fn => runAsync(fn)))
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
|
|
44
41
|
export function assertIsPromise(promiseError: Promise<any>) {
|
|
45
|
-
|
|
42
|
+
t(isPromise(promiseError))
|
|
46
43
|
}
|
|
47
44
|
|
|
48
45
|
export function assertIsError(err: Error) {
|
|
49
|
-
|
|
46
|
+
t(isError(err))
|
|
50
47
|
}
|
|
51
48
|
|
|
52
49
|
export function assertThrows<E extends Error>(fn: AnyFunction, ErrorType?: ErrorConstructor<E>): E {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
throw new Error(`${fn} does not throw as expected`)
|
|
50
|
+
try {
|
|
51
|
+
fn()
|
|
52
|
+
} catch (e: any) {
|
|
53
|
+
if (ErrorType && !(e instanceof ErrorType)) {
|
|
54
|
+
throw new Error(`thrown error ${e} is not of expected type ${ErrorType}`)
|
|
55
|
+
}
|
|
56
|
+
return e
|
|
57
|
+
}
|
|
58
|
+
throw new Error(`${fn} does not throw as expected`)
|
|
63
59
|
}
|
|
64
60
|
|
|
65
|
-
export async function assertAsyncThrows<E extends Error>(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
export async function assertAsyncThrows<E extends Error>(
|
|
62
|
+
fn: AnyFunction,
|
|
63
|
+
ErrorType?: ErrorConstructor<E>
|
|
64
|
+
): Promise<E> {
|
|
65
|
+
try {
|
|
66
|
+
await fn()
|
|
67
|
+
} catch (e: any) {
|
|
68
|
+
// console.log('catch clause', e)
|
|
69
|
+
if (ErrorType && !(e instanceof ErrorType)) {
|
|
70
|
+
throw new Error(`thrown error ${e} is not of expected type ${ErrorType}`)
|
|
71
|
+
}
|
|
72
|
+
// console.log('returning e')
|
|
73
|
+
return e
|
|
74
|
+
}
|
|
75
|
+
throw new Error(`${fn} does not throw as expected`)
|
|
78
76
|
}
|
|
79
77
|
|
|
80
|
-
|
|
81
78
|
export function noStackTraceFor(filename: string, err: Error) {
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
if (err.stack && RegExp(escapeRegExp(filename)).test(err.stack))
|
|
80
|
+
throw new Error(`contains internal stack: \n${err.stack}`)
|
|
84
81
|
}
|
package/ts/types.ts
CHANGED
package/ts/utils/index.ts
CHANGED
|
@@ -8,5 +8,5 @@ export * from './promiseMessages.js'
|
|
|
8
8
|
export * from './unexpectedErrorMessage.js'
|
|
9
9
|
|
|
10
10
|
export function failOnOccurrence(occurrence: number, error: any) {
|
|
11
|
-
|
|
11
|
+
return `Failed on ${occurrence} occurrence: ${tersify(error, { maxLength: Infinity })}`
|
|
12
12
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ErrorConstructor } from '../types.js'
|
|
1
|
+
import type { ErrorConstructor } from '../types.js'
|
|
2
2
|
|
|
3
3
|
export function isErrorConstructor(validator: any): validator is ErrorConstructor<any> {
|
|
4
|
-
|
|
4
|
+
return Object.prototype.isPrototypeOf.call(Error.prototype, validator.prototype)
|
|
5
5
|
}
|
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
import { Diff } from 'satisfier'
|
|
1
|
+
import type { Diff } from 'satisfier'
|
|
2
2
|
import { tersify } from 'tersify'
|
|
3
3
|
|
|
4
4
|
export function notSatisfiedMessage(entries: Diff[]) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
return entries
|
|
6
|
+
.map(e => {
|
|
7
|
+
const path = formatPath(e.path)
|
|
8
|
+
return `Expect ${path} to satisfy ${formatValue(e.expected)}, but received ${formatValue(e.actual)}`
|
|
9
|
+
})
|
|
10
|
+
.join('\n')
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
function formatPath(entries: (string | number)[]) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
if (entries.length === 0) return 'actual'
|
|
15
|
+
const nodes = [...entries]
|
|
16
|
+
if (isIndice(nodes[0])) {
|
|
17
|
+
nodes.unshift('actual')
|
|
18
|
+
}
|
|
19
|
+
return nodes
|
|
20
|
+
.map(n => (isIndice(n) ? `[${n}]` : '.' + n))
|
|
21
|
+
.join('')
|
|
22
|
+
.slice(1)
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
function isIndice(node: string | number): node is number {
|
|
22
|
-
|
|
26
|
+
return typeof node === 'number'
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
function formatValue(value: any) {
|
|
26
|
-
|
|
30
|
+
return tersify(value)
|
|
27
31
|
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { tersify } from 'tersify'
|
|
2
2
|
|
|
3
3
|
export function notRejectedMessage(value: any) {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
return (
|
|
5
|
+
`Expected promise to reject, but it resolves with ` +
|
|
6
|
+
(typeof value === 'string' ? `'${value}'` : tersify(value, { maxLength: Infinity }))
|
|
7
|
+
)
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
export function notResolvedMessage(error: any) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
return (
|
|
12
|
+
`Expected promise to resolve, but it rejects with ` +
|
|
13
|
+
(typeof error === 'string'
|
|
14
|
+
? `'${error}'`
|
|
15
|
+
: error instanceof Error
|
|
16
|
+
? error
|
|
17
|
+
: tersify(error, { maxLength: Infinity }))
|
|
18
|
+
)
|
|
11
19
|
}
|
|
12
|
-
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { tersify } from 'tersify'
|
|
2
|
-
import { ErrorConstructor, ErrorValidator } from '../types.js'
|
|
2
|
+
import type { ErrorConstructor, ErrorValidator } from '../types.js'
|
|
3
3
|
import { isErrorConstructor } from './isErrorConstructor.js'
|
|
4
4
|
|
|
5
5
|
export function unexpectedErrorMessage(actual: any, expected: ErrorValidator | ErrorConstructor<any>) {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
return `Unexpected error. Expecting '${
|
|
7
|
+
isErrorConstructor(expected) ? expected.name : tersify(expected)
|
|
8
|
+
}' but received ${tersify(actual)}`
|
|
8
9
|
}
|