简介
采用Cypress
对项目各单元进行测试,地址 -> cypress.io
下载
- mac系统,在
terminal
或iterm2
中 - win系统,在
cmd
或powershell
中
mkdir your_project && cd your_project # 创建项目目录
npm install cypress --save-dev # 下载cypress
node_modules/.bin/cypress open # 运行cypress
在官网下载desktop版本 -> download
运行配置
在 package.json
中添加 scripts
{
"license": "MIT",
"scripts": {
"cypress:open": "cypress open",
"cypress:run": "cypress run"
}
}
运行命令 -> npm run cypress:open