mocha.js - 如何将 mocha 错误符号更改为自定义字符串
问题描述
我正在尝试更改 mocha 的默认输出以测试成功和失败。我试过这个,它只适用于 ok 符号,但 err 没有变化
//.mocharc.js
const { symbols } = require('mocha/lib/reporters/base');
symbols.ok = '[PASS]'
symbols.err = '[FAIL]';
App
sayHello
[PASS] test sayHello should return hello
[PASS] test sayHello return type is string
returnNumber
[PASS] test returnNumber return 10
1) test returnNumber return type is number
plusFive
[PASS] test plusFive greater than 5
[PASS] test plusFive return type is number
myAbs
[PASS] test myAbs return absolute number
[PASS] test myAbs return type is number
7 passing (20ms)
1 failing
知道如何更改错误吗?
解决方案
推荐阅读
- excel - 有没有办法从excel复制多个值并将它们粘贴到访问订单表格中?
- intellij-idea - 在 IntelliJ 中找不到类无法运行或查看错误
- spring - 本地 m2 文件夹中缺少 jar 文件
- c++ - 敌人不跟随玩家 OpenGL 2D
- kotlin - 从kotlin中的字符串中拆分第一个和最后一个单词
- python - TensorFlow 2.6:num_parallel_calls 大于 1 但大部分时间只使用一个 CPU 内核
- r - 如何在同一个 excel 中的 3 个 excel 工作表中写入 3 个 diff 数据帧并保存在 r
- html - 将表单标签 input-group-prepend 与 bootstrap 对齐
- regex - 用于查找所有货币值的正则表达式
- python - Pandas 计算过滤数据集的时间增量