Skip to content

Commit

Permalink
chore: update cypress (pmndrs#2211)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaellis committed Dec 11, 2023
1 parent a9ed3d6 commit bcc6dec
Show file tree
Hide file tree
Showing 22 changed files with 688 additions and 297 deletions.
54 changes: 27 additions & 27 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,33 +149,33 @@ jobs:
yarn tsc --version
yarn test:ts
test-e2e:
needs: [build]
if: ${{ needs.changes.outputs.packages == 'true' }}
name: 'Test:E2E'
runs-on: ubuntu-latest
strategy:
matrix:
node: ['20.x']

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Install
run: yarn install --immutable

- name: Build
run: yarn build-ci

- name: Test
run: yarn test:e2e
# test-e2e:
# needs: [build]
# if: ${{ needs.changes.outputs.packages == 'true' }}
# name: 'Test:E2E'
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node: ['20.x']

# steps:
# - name: Checkout repo
# uses: actions/checkout@v4

# - name: Setup node ${{ matrix.node }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node }}
# cache: 'yarn'

# - name: Install
# run: yarn install --immutable

# - name: Build
# run: yarn build-ci

# - name: Test
# run: yarn test:e2e

test-published-artifact:
needs: [build]
Expand Down
18 changes: 18 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { defineConfig } from 'cypress'
import { addMatchImageSnapshotPlugin } from '@simonsmith/cypress-image-snapshot/plugin'

export default defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
video: false,
scrollBehavior: false,
fixturesFolder: false,
screenshotOnRunFailure: false,
excludeSpecPattern: ['**/__snapshots__/*'],
viewportHeight: 600,
viewportWidth: 1200,
setupNodeEvents(on) {
addMatchImageSnapshotPlugin(on)
},
},
})
8 changes: 0 additions & 8 deletions cypress.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ describe('Parallax - vertical', () => {
})

it('should translate layers as expected', () => {
// initial snapshot
console.log(HEIGHT, WIDTH)

cy.findByTestId('container').matchImageSnapshot('vertical #1', {
clip: { x: 0, y: 0, width: WIDTH, height: HEIGHT },
})
Expand Down
6 changes: 0 additions & 6 deletions cypress/plugins/index.js

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions cypress/support/commands.js

This file was deleted.

6 changes: 6 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import '@testing-library/cypress/add-commands'
import { addMatchImageSnapshotCommand } from '@simonsmith/cypress-image-snapshot/command'

addMatchImageSnapshotCommand({
capture: 'viewport',
})
20 changes: 0 additions & 20 deletions cypress/support/index.js

This file was deleted.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@
"@react-three/fiber": "^8.11.9",
"@remix-run/dev": "patch:@remix-run/dev@npm%3A1.15.0#./.yarn/patches/@remix-run-dev-npm-1.15.0-33b55fa3ee.patch",
"@remix-run/serve": "^1.15.0",
"@simonsmith/cypress-image-snapshot": "^9.0.1",
"@swc/core": "^1.3.41",
"@swc/jest": "^0.2.24",
"@testing-library/cypress": "^8.0.7",
"@testing-library/cypress": "^10.0.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@types/fs-extra": "^11.0.1",
Expand All @@ -85,8 +86,7 @@
"@types/react-native": "^0.71.3",
"@types/styled-components": "^5.1.26",
"@types/three": "^0.149.0",
"cypress": "^9.7.0",
"cypress-image-snapshot": "^4.0.1",
"cypress": "^13.6.1",
"eslint": "^8.36.0",
"flush-microtasks": "^1.0.1",
"husky": "^8.0.3",
Expand All @@ -102,12 +102,12 @@
"react-native": "^0.71.3",
"react-zdog": "^1.0.11",
"spec.ts": "^1.1.3",
"start-server-and-test": "^2.0.0",
"start-server-and-test": "^2.0.3",
"three": "^0.150.1",
"tsup": "^6.7.0",
"turbo": "^1.8.3",
"typescript": "5.2.2",
"vite": "^4.1.4",
"vite": "^5.0.7",
"zdog": "^1.1.3"
},
"publishConfig": {
Expand Down
Loading

0 comments on commit bcc6dec

Please sign in to comment.