Node.js 我如何给出特定文件夹的路径,并使用npm脚本运行该文件夹中的cypress规范

Node.js 我如何给出特定文件夹的路径,并使用npm脚本运行该文件夹中的cypress规范,node.js,cypress,Node.js,Cypress,在我的cypress测试中,我在集成文件夹下的桌面和移动文件夹中编写了测试。当我从Git bash cli运行npm run cy:mobile atp时,它也在运行桌面文件夹中的所有cypress spec文件。如何仅运行与手机相关的规范 "scripts": { "cy:run": "cypress run", "cy:desktop-atp": "set CYPRESS_RETRIES=2 && cypress run --record

在我的cypress测试中,我在集成文件夹下的
桌面
移动
文件夹中编写了测试。当我从Git bash cli运行
npm run cy:mobile atp
时,它也在运行桌面文件夹中的所有cypress spec文件。如何仅运行与手机相关的规范

  "scripts": {
        "cy:run": "cypress run",
        "cy:desktop-atp": "set CYPRESS_RETRIES=2 && cypress run --record --key <some record key> --spec cypress/integration/desktop/**/*",
        "cy:mobile-atp":"node integration-tests.js --mobile --record --key <some record key> --spec cypress/integration/mobile/**/*"
      },
“脚本”:{
“赛:跑”:“赛普拉斯跑”,
“cy:desktop atp”:“set-CYPRESS_RETRIES=2&&CYPRESS run--record--key--spec CYPRESS/integration/desktop/***”,
“cy:mobile-atp”:“node integration-tests.js--mobile--record--key--spec-cypress/integration/mobile/***”
},

这里有几个建议。首先是使用一个尾随逗号,我想是
--spec-cypress/integration/desktop/***,“
。其次是将glob用单引号括起来,即
--spec'cypress/integration/desktop/***'”
。这里有一些建议。首先是使用一个尾随逗号,我想是
--spec-cypress/integration/desktop/***,”
。其次是将glob用单引号括起来,即
--spec'cypress/integration/desktop/***'”