【发布时间】:2021-07-18 01:41:51
【问题描述】:
我想使用 CircleCi 来运行我的 Cypress 和 react-testing-library 测试,因为我想测试我的 react 应用程序。 在本地环境中我会运行(工作正常):
-
yarn run test执行我的 react-testing-library 测试 -
yarn cypress run执行 Cypress 测试
现在,我找到了有关如何制作 circleci config.yaml 的资源,但没有任何效果。供参考link1、link2、link3、link4、link5
某些测试失败的原因是:error cypress@7.1.0: The engine "node" is incompatible with this module. Expected version ">=12.0.0". Got "10.24.1" 或错误兑现或其他原因。跑了 20 次后我一无所知,请有人帮帮我吗?
当我浏览资源时,我认为这应该适用于赛普拉斯测试,但它没有。
version: 2.1
orbs:
cypress: cypress-io/cypress@1
workflows:
build:
jobs:
- cypress/install:
build: yarn run build # run a custom app build step
yarn: true
- cypress/run:
requires:
- cypress/install
parallel: true # split all specs across machines
parallelism: 4 # use 4 CircleCI machines to finish quickly
yarn: true
group: 'all tests' # name this group "all tests" on the dashboard
start: yarn start # start server before running tests
【问题讨论】:
标签: cypress circleci react-testing-library circleci-2.0