|
|
@ -26,8 +26,6 @@ class AssertionError extends Error { |
|
|
|
|
|
|
|
if (opts.stack) { |
|
|
|
this.stack = opts.stack; |
|
|
|
} else { |
|
|
|
Error.captureStackTrace(this, opts.stackStartFunction); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -52,8 +50,7 @@ function wrapAssertions(callbacks) { |
|
|
|
fail(message) { |
|
|
|
fail(this, new AssertionError({ |
|
|
|
assertion: 'fail', |
|
|
|
message: message || 'Test failed via t.fail()', |
|
|
|
stackStartFunction: assertions.fail |
|
|
|
message: message || 'Test failed via t.fail()' |
|
|
|
})); |
|
|
|
}, |
|
|
|
|
|
|
@ -66,8 +63,7 @@ function wrapAssertions(callbacks) { |
|
|
|
assertion: 'is', |
|
|
|
expected, |
|
|
|
message, |
|
|
|
operator: '===', |
|
|
|
stackStartFunction: assertions.is |
|
|
|
operator: '===' |
|
|
|
})); |
|
|
|
} |
|
|
|
}, |
|
|
@ -79,8 +75,7 @@ function wrapAssertions(callbacks) { |
|
|
|
assertion: 'not', |
|
|
|
expected, |
|
|
|
message, |
|
|
|
operator: '!==', |
|
|
|
stackStartFunction: assertions.not |
|
|
|
operator: '!==' |
|
|
|
})); |
|
|
|
} else { |
|
|
|
pass(this); |
|
|
@ -95,8 +90,7 @@ function wrapAssertions(callbacks) { |
|
|
|
actual, |
|
|
|
assertion: 'deepEqual', |
|
|
|
expected, |
|
|
|
message, |
|
|
|
stackStartFunction: assertions.deepEqual |
|
|
|
message |
|
|
|
})); |
|
|
|
} |
|
|
|
}, |
|
|
@ -107,8 +101,7 @@ function wrapAssertions(callbacks) { |
|
|
|
actual, |
|
|
|
assertion: 'notDeepEqual', |
|
|
|
expected, |
|
|
|
message, |
|
|
|
stackStartFunction: assertions.notDeepEqual |
|
|
|
message |
|
|
|
})); |
|
|
|
} else { |
|
|
|
pass(this); |
|
|
@ -153,8 +146,7 @@ function wrapAssertions(callbacks) { |
|
|
|
} catch (err) { |
|
|
|
throw new AssertionError({ |
|
|
|
assertion: 'throws', |
|
|
|
message, |
|
|
|
stackStartFunction: assertions.throws |
|
|
|
message |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
@ -195,8 +187,7 @@ function wrapAssertions(callbacks) { |
|
|
|
throw new AssertionError({ |
|
|
|
actual: err.actual, |
|
|
|
assertion: 'notThrows', |
|
|
|
message, |
|
|
|
stackStartFunction: assertions.notThrows |
|
|
|
message |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
@ -223,8 +214,7 @@ function wrapAssertions(callbacks) { |
|
|
|
fail(this, new AssertionError({ |
|
|
|
actual, |
|
|
|
assertion: 'ifError', |
|
|
|
message, |
|
|
|
stackStartFunction: assertions.ifError |
|
|
|
message |
|
|
|
})); |
|
|
|
} else { |
|
|
|
pass(this); |
|
|
@ -240,8 +230,7 @@ function wrapAssertions(callbacks) { |
|
|
|
actual, |
|
|
|
assertion: 'snapshot', |
|
|
|
expected: result.expected, |
|
|
|
message: result.message, |
|
|
|
stackStartFunction: assertions.snapshot |
|
|
|
message: result.message |
|
|
|
})); |
|
|
|
} |
|
|
|
} |
|
|
@ -255,8 +244,7 @@ function wrapAssertions(callbacks) { |
|
|
|
assertion: 'truthy', |
|
|
|
expected: true, |
|
|
|
message, |
|
|
|
operator: '==', |
|
|
|
stackStartFunction: enhancedAssertions.truthy |
|
|
|
operator: '==' |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
@ -268,8 +256,7 @@ function wrapAssertions(callbacks) { |
|
|
|
assertion: 'falsy', |
|
|
|
expected: false, |
|
|
|
message, |
|
|
|
operator: '==', |
|
|
|
stackStartFunction: enhancedAssertions.falsy |
|
|
|
operator: '==' |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
@ -281,8 +268,7 @@ function wrapAssertions(callbacks) { |
|
|
|
assertion: 'true', |
|
|
|
expected: true, |
|
|
|
message, |
|
|
|
operator: '===', |
|
|
|
stackStartFunction: enhancedAssertions.true |
|
|
|
operator: '===' |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
@ -294,8 +280,7 @@ function wrapAssertions(callbacks) { |
|
|
|
assertion: 'false', |
|
|
|
expected: false, |
|
|
|
message, |
|
|
|
operator: '===', |
|
|
|
stackStartFunction: enhancedAssertions.false |
|
|
|
operator: '===' |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
@ -306,8 +291,7 @@ function wrapAssertions(callbacks) { |
|
|
|
actual, |
|
|
|
assertion: 'regex', |
|
|
|
expected, |
|
|
|
message, |
|
|
|
stackStartFunction: enhancedAssertions.regex |
|
|
|
message |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
@ -318,8 +302,7 @@ function wrapAssertions(callbacks) { |
|
|
|
actual, |
|
|
|
assertion: 'notRegex', |
|
|
|
expected, |
|
|
|
message, |
|
|
|
stackStartFunction: enhancedAssertions.notRegex |
|
|
|
message |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|