Skip to content

Commit 5e4b638

Browse files
fix: make imported @cypress/react working and pass CI (#8718)
Co-authored-by: Jessica Sachs <jess@jessicasachs.io>
1 parent 6716d70 commit 5e4b638

File tree

399 files changed

+69426
-52389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

399 files changed

+69426
-52389
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ npm/webpack-preprocessor/examples/use-babelrc/cypress/integration/spec.js
3939
**/.history
4040
**/.cy
4141
**/.git
42+
43+
/npm/react/bin/*

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -312,4 +312,5 @@ $RECYCLE.BIN/
312312
# Windows shortcuts
313313
*.lnk
314314

315+
/npm/react/bin/*
315316
# End of https://www.gitignore.io/api/osx,git,node,windows,intellij,linux

circle.yml

+142-2
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,7 @@ commands:
383383
steps:
384384
- run:
385385
name: "Waiting on Circle CI jobs: <<parameters.job-names>>"
386-
command: node ./scripts/wait-on-circle-jobs.js --job-names="<<parameters.job-names>>"
387-
386+
command: node ./scripts/wait-on-circle-jobs.js --job-names="<<parameters.job-names>>"q
388387
jobs:
389388
## code checkout and yarn installs
390389
build:
@@ -1066,6 +1065,66 @@ jobs:
10661065
- run:
10671066
name: Release
10681067
command: yarn semantic-release @cypress/vue
1068+
1069+
npm-react:
1070+
<<: *defaults
1071+
steps:
1072+
- attach_workspace:
1073+
at: ~/
1074+
- run:
1075+
name: Build
1076+
command: yarn workspace @cypress/react build
1077+
- run:
1078+
name: Run unit test
1079+
command: yarn workspace @cypress/react test:unit
1080+
- run:
1081+
name: Run tests
1082+
command: yarn workspace @cypress/react test
1083+
- store-npm-logs
1084+
- persist_to_workspace:
1085+
root: ~/
1086+
paths: cypress/npm/react
1087+
1088+
npm-react-e2e-example:
1089+
<<: *defaults
1090+
description: Run react component testing end-to-end examples
1091+
parameters:
1092+
executor:
1093+
description: Executor name to use
1094+
type: executor
1095+
default: cy-doc
1096+
path:
1097+
description: relative to npm/react path of example
1098+
type: string
1099+
steps:
1100+
- attach_workspace:
1101+
at: ~/
1102+
- restore_cache:
1103+
name: Restore Cache
1104+
keys:
1105+
- yarn-packages-{{ checksum "npm/react/<<parameters.path>>/yarn.lock" }}
1106+
- run:
1107+
name: Install Dependencies
1108+
command: yarn install --frozen-lockfile
1109+
working_directory: npm/react/<<parameters.path>>
1110+
- save_cache:
1111+
name: Save Cache
1112+
key: yarn-packages-{{ checksum "npm/react/<<parameters.path>>/yarn.lock" }}
1113+
paths:
1114+
- ~/.cache
1115+
- run:
1116+
name: Run e2e example tests
1117+
command: yarn test
1118+
working_directory: npm/react/<<parameters.path>>
1119+
1120+
npm-react-release:
1121+
<<: *defaults
1122+
steps:
1123+
- attach_workspace:
1124+
at: ~/
1125+
- run:
1126+
name: Release
1127+
command: yarn semantic-release @cypress/react
10691128

10701129
npm-eslint-plugin-dev:
10711130
<<: *defaults
@@ -1885,6 +1944,87 @@ linux-workflow: &linux-workflow
18851944
- build
18861945
- npm-vue
18871946

1947+
- npm-react:
1948+
requires:
1949+
- build
1950+
1951+
# Run tests for end-to-end react component tests examples
1952+
- npm-react-e2e-example:
1953+
name: React + Axe component testing
1954+
path: examples/a11y
1955+
requires:
1956+
- npm-react
1957+
- npm-react-e2e-example:
1958+
name: React + Next component testing
1959+
path: examples/nextjs
1960+
requires:
1961+
- npm-react
1962+
- npm-react-e2e-example:
1963+
name: React + CRA component testing
1964+
path: examples/react-scripts
1965+
requires:
1966+
- npm-react
1967+
- npm-react-e2e-example:
1968+
name: React + CRA folder component testing
1969+
path: examples/react-scripts-folder
1970+
requires:
1971+
- npm-react
1972+
- npm-react-e2e-example:
1973+
name: React + Rollup component testing
1974+
path: examples/rollup
1975+
requires:
1976+
- npm-react
1977+
- npm-react-e2e-example:
1978+
name: React + Sass + TS component testing
1979+
path: examples/sass-and-ts
1980+
requires:
1981+
- npm-react
1982+
- npm-react-e2e-example:
1983+
name: React + Snapshots component testing
1984+
path: examples/snapshots
1985+
requires:
1986+
- npm-react
1987+
- npm-react-e2e-example:
1988+
name: React + Tailwind component testing
1989+
path: examples/tailwind
1990+
requires:
1991+
- npm-react
1992+
# Requires Applitools key in the env
1993+
# - npm-react-e2e-example:
1994+
# name: React + Applitools component testing
1995+
# path: examples/visual-testing-with-applitools
1996+
# requires:
1997+
# - npm-react
1998+
- npm-react-e2e-example:
1999+
name: React + Percy component testing
2000+
path: examples/visual-testing-with-percy
2001+
requires:
2002+
- npm-react
2003+
- npm-react-e2e-example:
2004+
name: React + Happo component testing
2005+
path: examples/visual-testing-with-happo
2006+
requires:
2007+
- npm-react
2008+
- npm-react-e2e-example:
2009+
name: React + Webpack file component testing
2010+
path: examples/webpack-file
2011+
requires:
2012+
- npm-react
2013+
- npm-react-e2e-example:
2014+
name: React + Webpack options component testing
2015+
path: examples/webpack-options
2016+
requires:
2017+
- npm-react
2018+
2019+
- npm-react-release:
2020+
filters:
2021+
branches:
2022+
only:
2023+
- master
2024+
requires:
2025+
- build
2026+
- npm-vue
2027+
18882028
- npm-eslint-plugin-dev:
18892029
requires:
18902030
- build

npm/react/.eslintrc

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"plugins": [
3+
"cypress",
4+
"@cypress/dev"
5+
],
6+
"extends": [
7+
"plugin:@cypress/dev/general",
8+
"plugin:@cypress/dev/tests",
9+
"plugin:@cypress/dev/react"
10+
],
11+
"parser": "@typescript-eslint/parser",
12+
"env": {
13+
"cypress/globals": true
14+
},
15+
"globals": {
16+
"jest": "readonly"
17+
},
18+
"rules": {
19+
"no-console": "off",
20+
"mocha/no-global-tests": "off",
21+
"@typescript-eslint/no-unused-vars": "off",
22+
"react/jsx-filename-extension": [
23+
"warn",
24+
{
25+
"extensions": [
26+
".js",
27+
".jsx",
28+
".tsx"
29+
]
30+
}
31+
]
32+
},
33+
"overrides": [
34+
{
35+
"files": [
36+
"lib/*"
37+
],
38+
"rules": {
39+
"no-console": 1
40+
}
41+
},
42+
{
43+
"files": [
44+
"**/*.json"
45+
],
46+
"rules": {
47+
"quotes": "off",
48+
"comma-dangle": "off"
49+
}
50+
}
51+
]
52+
}

npm/react/.github/PULL_REQUEST_TEMPLATE.md

-9
This file was deleted.

npm/react/.gitignore

-12
This file was deleted.

npm/react/.mocharc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"watch-ignore": [
3+
"node_modules"
4+
],
5+
"require": "ts-node/register",
6+
"exit": true
7+
}

npm/react/.npmrc

-2
This file was deleted.

npm/react/.prettierrc.json

-6
This file was deleted.

npm/react/.vscode/launch.json

-29
This file was deleted.

npm/react/.vscode/settings.json

-29
This file was deleted.

0 commit comments

Comments
 (0)