Skip to content

Commit

Permalink
chore(workspace): upgrade to cypress v11 (#2816)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock authored Nov 22, 2022
1 parent 1f51a1e commit 1504a44
Show file tree
Hide file tree
Showing 15 changed files with 364 additions and 330 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
- name: e2e tests 🧪
uses: cypress-io/github-action@v4
with:
command: yarn cypress run-ct
command: yarn cypress run --component
working-directory: packages/react-urql

graphcache-e2e:
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
- name: e2e tests 🧪
uses: cypress-io/github-action@v4
with:
command: yarn cypress run-ct
command: yarn cypress run --component
working-directory: exchanges/graphcache

build:
Expand Down
21 changes: 21 additions & 0 deletions exchanges/graphcache/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// eslint-disable-next-line
const { defineConfig } = require('cypress');

module.exports = defineConfig({
video: false,

component: {
specPattern: './**/e2e-tests/*spec.tsx',
devServer: {
framework: 'react',
bundler: 'vite',
viteConfig: {
server: {
fs: {
allow: ['../..'],
},
},
},
},
},
});
7 changes: 0 additions & 7 deletions exchanges/graphcache/cypress.json

This file was deleted.

25 changes: 0 additions & 25 deletions exchanges/graphcache/cypress/support/commands.js

This file was deleted.

12 changes: 12 additions & 0 deletions exchanges/graphcache/cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Components App</title>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ***********************************************************
// This example support/index.js is processed and
// This example support/component.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
Expand All @@ -13,8 +13,9 @@
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands';
import { mount } from 'cypress/react';

// Alternatively you can use CommonJS syntax:
// require('./commands')
Cypress.Commands.add('mount', mount);

// Example use:
// cy.mount(<MyComponent />)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"cjs-module-lexer": "^1.2.2",
"cypress": "^9.5.1",
"cypress": "^11.0.0",
"dotenv": "^8.2.0",
"eslint": "^7.25.0",
"eslint-config-prettier": "^8.3.0",
Expand Down
21 changes: 21 additions & 0 deletions packages/react-urql/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// eslint-disable-next-line
const { defineConfig } = require('cypress');

module.exports = defineConfig({
video: false,

component: {
specPattern: './**/e2e-tests/*spec.tsx',
devServer: {
framework: 'react',
bundler: 'vite',
viteConfig: {
server: {
fs: {
allow: ['..'],
},
},
},
},
},
});
7 changes: 0 additions & 7 deletions packages/react-urql/cypress.json

This file was deleted.

15 changes: 0 additions & 15 deletions packages/react-urql/cypress/plugins/index.js

This file was deleted.

25 changes: 0 additions & 25 deletions packages/react-urql/cypress/support/commands.js

This file was deleted.

12 changes: 12 additions & 0 deletions packages/react-urql/cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Components App</title>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ***********************************************************
// This example support/index.js is processed and
// This example support/component.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
Expand All @@ -13,8 +13,6 @@
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands';
import { mount } from 'cypress/react';

// Alternatively you can use CommonJS syntax:
// require('./commands')
Cypress.Commands.add('mount', mount);
6 changes: 3 additions & 3 deletions packages/react-urql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"preset": "../../scripts/jest/preset"
},
"devDependencies": {
"@cypress/react": "^5.12.4",
"@cypress/vite-dev-server": "^2.2.2",
"@cypress/react": "^7.0.1",
"@cypress/vite-dev-server": "^4.0.1",
"@testing-library/react": "^11.1.1",
"@testing-library/react-hooks": "^5.1.2",
"@types/react": "^17.0.4",
Expand All @@ -55,7 +55,7 @@
"react-is": "^17.0.1",
"react-ssr-prepass": "^1.1.2",
"react-test-renderer": "^17.0.1",
"vite": "^2.8.6"
"vite": "^3.0.0"
},
"peerDependencies": {
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0",
Expand Down
Loading

0 comments on commit 1504a44

Please sign in to comment.