mirror of
https://github.com/denoland/deno.git
synced 2025-02-02 04:38:21 -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) {
|
} catch (e) {
|
||||||
expectedString = "[Cannot display]";
|
expectedString = "[Cannot display]";
|
||||||
}
|
}
|
||||||
console.error(
|
|
||||||
"Not Equals failed. actual =",
|
|
||||||
actualString,
|
|
||||||
"expected =",
|
|
||||||
expectedString
|
|
||||||
);
|
|
||||||
if (!msg) {
|
if (!msg) {
|
||||||
msg = `actual: ${actualString} expected: ${expectedString}`;
|
msg = `actual: ${actualString} expected: ${expectedString}`;
|
||||||
}
|
}
|
||||||
|
@ -138,12 +132,6 @@ export function assertStrictEq(
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
expectedString = "[Cannot display]";
|
expectedString = "[Cannot display]";
|
||||||
}
|
}
|
||||||
console.error(
|
|
||||||
"strictEqual failed. actual =",
|
|
||||||
actualString,
|
|
||||||
"expected =",
|
|
||||||
expectedString
|
|
||||||
);
|
|
||||||
if (!msg) {
|
if (!msg) {
|
||||||
msg = `actual: ${actualString} expected: ${expectedString}`;
|
msg = `actual: ${actualString} expected: ${expectedString}`;
|
||||||
}
|
}
|
||||||
|
@ -161,12 +149,6 @@ export function assertStrContains(
|
||||||
msg?: string
|
msg?: string
|
||||||
): void {
|
): void {
|
||||||
if (!actual.includes(expected)) {
|
if (!actual.includes(expected)) {
|
||||||
console.error(
|
|
||||||
"stringContains failed. actual =",
|
|
||||||
actual,
|
|
||||||
"not containing ",
|
|
||||||
expected
|
|
||||||
);
|
|
||||||
if (!msg) {
|
if (!msg) {
|
||||||
msg = `actual: "${actual}" expected to contains: "${expected}"`;
|
msg = `actual: "${actual}" expected to contains: "${expected}"`;
|
||||||
}
|
}
|
||||||
|
@ -199,12 +181,6 @@ export function assertArrayContains(
|
||||||
if (missing.length === 0) {
|
if (missing.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.error(
|
|
||||||
"assertArrayContains failed. actual=",
|
|
||||||
actual,
|
|
||||||
"not containing ",
|
|
||||||
expected
|
|
||||||
);
|
|
||||||
if (!msg) {
|
if (!msg) {
|
||||||
msg = `actual: "${actual}" expected to contains: "${expected}"`;
|
msg = `actual: "${actual}" expected to contains: "${expected}"`;
|
||||||
msg += "\n";
|
msg += "\n";
|
||||||
|
@ -223,12 +199,6 @@ export function assertMatch(
|
||||||
msg?: string
|
msg?: string
|
||||||
): void {
|
): void {
|
||||||
if (!expected.test(actual)) {
|
if (!expected.test(actual)) {
|
||||||
console.error(
|
|
||||||
"stringMatching failed. actual =",
|
|
||||||
actual,
|
|
||||||
"not matching RegExp ",
|
|
||||||
expected
|
|
||||||
);
|
|
||||||
if (!msg) {
|
if (!msg) {
|
||||||
msg = `actual: "${actual}" expected to match: "${expected}"`;
|
msg = `actual: "${actual}" expected to match: "${expected}"`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue