mirror of
https://github.com/denoland/deno.git
synced 2025-01-22 23:19:55 -05:00
Remove console.error from asserts. (denoland/deno_std#483)
Original: 2292fbe6b1
This commit is contained in:
parent
33b6055f5f
commit
8e8f936e40
1 changed files with 0 additions and 30 deletions
|
@ -104,12 +104,6 @@ export function assertNotEquals(
|
|||
} catch (e) {
|
||||
expectedString = "[Cannot display]";
|
||||
}
|
||||
console.error(
|
||||
"Not Equals failed. actual =",
|
||||
actualString,
|
||||
"expected =",
|
||||
expectedString
|
||||
);
|
||||
if (!msg) {
|
||||
msg = `actual: ${actualString} expected: ${expectedString}`;
|
||||
}
|
||||
|
@ -138,12 +132,6 @@ export function assertStrictEq(
|
|||
} catch (e) {
|
||||
expectedString = "[Cannot display]";
|
||||
}
|
||||
console.error(
|
||||
"strictEqual failed. actual =",
|
||||
actualString,
|
||||
"expected =",
|
||||
expectedString
|
||||
);
|
||||
if (!msg) {
|
||||
msg = `actual: ${actualString} expected: ${expectedString}`;
|
||||
}
|
||||
|
@ -161,12 +149,6 @@ export function assertStrContains(
|
|||
msg?: string
|
||||
): void {
|
||||
if (!actual.includes(expected)) {
|
||||
console.error(
|
||||
"stringContains failed. actual =",
|
||||
actual,
|
||||
"not containing ",
|
||||
expected
|
||||
);
|
||||
if (!msg) {
|
||||
msg = `actual: "${actual}" expected to contains: "${expected}"`;
|
||||
}
|
||||
|
@ -199,12 +181,6 @@ export function assertArrayContains(
|
|||
if (missing.length === 0) {
|
||||
return;
|
||||
}
|
||||
console.error(
|
||||
"assertArrayContains failed. actual=",
|
||||
actual,
|
||||
"not containing ",
|
||||
expected
|
||||
);
|
||||
if (!msg) {
|
||||
msg = `actual: "${actual}" expected to contains: "${expected}"`;
|
||||
msg += "\n";
|
||||
|
@ -223,12 +199,6 @@ export function assertMatch(
|
|||
msg?: string
|
||||
): void {
|
||||
if (!expected.test(actual)) {
|
||||
console.error(
|
||||
"stringMatching failed. actual =",
|
||||
actual,
|
||||
"not matching RegExp ",
|
||||
expected
|
||||
);
|
||||
if (!msg) {
|
||||
msg = `actual: "${actual}" expected to match: "${expected}"`;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue