npm - “Cypress Run”的路径问题
问题描述
我在 Cypress 方面取得了不错的进展,但在尝试调用单个 Spec 时有点卡住了。
中的行package.json
看起来像:
"cypress:runST": "cypress run --spec'/cypress/integration/02_DBM_H1_ST_spec.js'",
我从npm run cypress:runST
...错误开始!
即使我尝试将其运行为:
`npm run cypress run --spec '/cypress/integration/02_DBM_H1_ST_spec.js'
我仍然收到错误:
Can't run because no spec files were found.
We searched for any files matching this glob pattern:
'\cypress\integration\02_DBM_H1_ST_spec.js'
并来自 NPM 日志:
10 silly lifecycle cypress_research@1.0.0~cypress:runST: Args: [ '/d /s /c',
10 silly lifecycle 'cypress run --spec \'/cypress/integration/02_DBM_H1_ST_spec.js\'' ]
11 silly lifecycle cypress_research@1.0.0~cypress:runST: Returned: code: 1 signal: null
12 info lifecycle cypress_research@1.0.0~cypress:runST: Failed to exec cypress:runST script
我有一种感觉,这是命令中的语法,但如果是这种情况,它会再次运行“裸”......但我得到了同样的错误。不知道 '\' afer spec 和之后的 .js 来自哪里。
请问有什么想法吗?谢谢
解决方案
假设 package.json 与 cypress 文件夹处于同一级别,这应该可以工作
"cypress:runST": "cypress run --spec cypress/integration/02_DBM_H1_ST_spec.js",
推荐阅读
- php - Laravel:如何创建下拉列表以从其他表中选择 FOREIGN KEY?
- asp.net-core - .Net core Api 作为 Windows 服务运行,在其套接字上获得禁止访问
- javascript - 样式组件中的关键帧动画
- lisp - 是否存在 McCLIM Click Listener?
- mysql - MySQL 将查询结果插入数据库
- r - 在R中删除具有多个条件的行
- reactjs - 如何使用新的泛型重新定义类型
- typescript - 在使用 hasOwnProperty 分配之前使用变量
- java - org.springframework.expression.spel.SpelEvaluationException:EL1007E:在 null 上找不到属性或字段“id”
- keras - keras 验证指标 r2_score 异常