【发布时间】:2020-03-26 10:43:29
【问题描述】:
我正在使用 mocha.opts 文件在 VS Code 中配置我的测试。
DeprecationWarning: Configuration via mocha.opts is DEPRECATED and will be removed from a future version of Mocha. Use RC files or package.json instead.
我现在无法运行我的测试并希望迁移到 mocharc 文件。 我不介意 mocharc 格式是 yaml 或 json。 mocha 文档很长,没有提供迁移示例。
Q1:怎么做,有例子吗?
EDIT:
我发现了这个:https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.yml
这是一个包含所有可能字段的 .mocharc.yaml 配置示例。
Q2:env vars 呢,我可以在 mocha.opts 中设置它们,如何在 .mocharc 中设置?
【问题讨论】: