1.6 mocha配置文件的使用

1、使用mocha执行自动化时,一般使用mocha追加命令行参数的形式来执行

mocha也支持以配置文件的形式来执行

 在根目录创建配置文件,下文是yml配置文件的官方示例

路径中必须要包含具体要执行的文件名

# This is an example Mocha config containing every Mocha option plus others.
allow-uncaught: false
async-only: false
bail: false
check-leaks: false
color: true
delay: false
diff: true
exit: false # could be expressed as "no-exit: true"
extension:
  - 'js'
# fgrep and grep are mutually exclusive
# fgrep: something
file:
  - '/path/to/some/file'
  - '/path/to/some/other/file'
forbid-only: false
forbid-pending: false
full-trace: false
global:
  - 'jQuery'
  - '$'
# fgrep and grep are mutually exclusive
# grep: something
growl: false
ignore:
  - '/path/to/some/ignored/file'
inline-diffs: false
# needs to be used with grep or fgrep
# invert: false
jobs: 1
package: './package.json'
parallel: false
recursive: false
reporter: 'spec'
reporter-option:
  - 'foo=bar'
  - 'baz=quux'
require: '@babel/register'
retries: 1
slow: '75'
sort: false
spec:
  - 'test/**/*.spec.js' # the positional arguments!
timeout: '2000' # same as "timeout: '2s'"
# timeout: false # same as "no-timeout: true" or "timeout: 0"
trace-warnings: true # node flags ok
ui: 'bdd'
v8-stack-trace-limit: 100 # V8 flags are prepended with "v8-"
watch: false
watch-files:
  - 'lib/**/*.js'
  - 'test/**/*.js'
watch-ignore:
  - 'lib/vendor'

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值