Skip to content
chris edited this page Jul 26, 2016 · 6 revisions

KAB 命令参数

kab

$ kab --help

$ kab --version

options

名称 别名 值类型 默认值 说明
help h boolean false 显示帮助信息
version v boolean false 显示 KAB 的版本信息

init

$ kab init [options]

当需要支持浏览器端 BDD 测试时,需要初始化测试配置文件。

options

名称 别名 值类型 默认值 说明
force f boolean true 当已存在 test/config.js 文件时是否覆盖

start

$ kab [start] [pattern...] [options]

开始测试。当指定的 pattern 中包含 Markdown 文件时,将运行基于 Benchmark.js 的测试。

options

名称 别名 值类型 默认值 说明
browsers b string[] -- 指定运行的浏览器名称,可以为一个或多个浏览器名称:(Chrome、Firefox、Opera、Safari、PhantomJS、IE)
count -- number 10 bechmark case 的运行次数
debug -- boolean false 是否允许直接抛出 KAB 的运行时错误
jasmine -- string -- 指定 jasmine 的版本
node -- boolean false 指定是否在 Node.js 下运行测试
port -- number 8120 指定 WebServer 运行的端口
singleRun -- boolean true 测试运行完成后是否退出
sync -- boolean true 指定性能测试时 Benchmark.js 的运行模式
watch -- boolean false 是否监听相关的文件变更后自动重运行所有测试,通常还需要指定 singleRun 为 false

index

名称 别名 值类型 默认值 说明
browsers b string[] -- 指定运行的浏览器名称,可以为一个或多个浏览器名称:(Chrome、Firefox、Opera、Safari、PhantomJS、IE)
count -- number 10 bechmark case 的运行次数
debug -- boolean false 是否允许直接抛出 KAB 的运行时错误
force f boolean true 当已存在 test/config.js 文件时是否覆盖
help h boolean false 显示帮助信息
jasmine -- string -- 指定 jasmine 的版本
node -- boolean false 指定是否在 Node.js 下运行测试
port -- number 8120 指定 WebServer 运行的端口
singleRun -- boolean true 测试运行完成后是否退出
sync -- boolean true 指定性能测试时 Benchmark.js 的运行模式
version v boolean false 显示 KAB 的版本信息
watch -- boolean false 是否监听相关的文件变更后自动重运行所有测试,通常还需要指定 singleRun 为 false
Clone this wiki locally