feat: colorize checker output
This commit is contained in:
parent
980feed749
commit
2f2ab1eeb0
@ -195,9 +195,9 @@ for (const msg of SAMPLES) {
|
|||||||
const validationResult = validator(msg);
|
const validationResult = validator(msg);
|
||||||
|
|
||||||
if (validationResult.success) {
|
if (validationResult.success) {
|
||||||
console.log(`msg ${msg.id}: OK`);
|
console.log(`msg ${msg.id}: \x1b[32mOK\x1b[0m`);
|
||||||
} else {
|
} else {
|
||||||
console.log(`msg ${msg.id}: ERROR`);
|
console.log(`msg ${msg.id}: \x1b[31mERROR\x1b[0m`);
|
||||||
for (const error of validationResult.errors) {
|
for (const error of validationResult.errors) {
|
||||||
console.log(` - ${error.path}, expected ${error.expected}, found value ${error.value}`);
|
console.log(` - ${error.path}, expected ${error.expected}, found value ${error.value}`);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user