Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,6 @@ Each package is responsible for building itself and testing itself and can do so
When executing top or package level scripts, [Vite](https://vitejs.dev/) may be used to build/host parts of the application. This section is to serve as a general reference for these environment variables that may be leverage throughout the repository.
##### `CYPRESS_INTERNAL_VITE_DEV`
Set to `1` if wanting to leverage [vite's](https://vitejs.dev/guide/#command-line-interface) `vite dev` over `vite build` to avoid a full [production build](https://vitejs.dev/guide/build.html).
##### `CYPRESS_INTERNAL_VITE_INSPECT`
Used internally to leverage [vite-plugin-inspect](https://github.com/antfu/vite-plugin-inspect) to view intermediary vite plugin state. The `CYPRESS_INTERNAL_VITE_DEV` is required for this to be applied correctly. Set to `1` to enable.
##### `CYPRESS_INTERNAL_VITE_OPEN_MODE_TESTING`
Leveraged only for internal cy-in-cy type tests to access the Cypress instance from the parent frame. Please see the [E2E Open Mode Testing](./guides/e2e-open-testing.md) Guide. Set to `true` when doing
##### `CYPRESS_INTERNAL_VITE_APP_PORT`
Expand Down
70 changes: 65 additions & 5 deletions knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,18 @@
"entry": [
"src/browser.ts",
"src/loader.ts",
"src/aut-runner.ts"
"src/aut-runner.ts",
"cypress/e2e/webpack-dev-server.cy.ts",
"cypress/e2e/react.cy.ts"
],
"project": [
"src/**/*.{ts,tsx,js,jsx}",
"*.{ts,tsx,js,jsx}"
],
"ignoreDependencies": [
"@angular-devkit/core",
"next",
"html-webpack-plugin"
]
},
"npm/cypress-schematic": {
Expand All @@ -397,6 +404,11 @@
],
"project": [
"src/**/*.{ts,tsx,js,jsx}"
],
"ignoreDependencies": [
"@angular-devkit/schematics-cli",
"@angular/cli",
"@schematics/angular"
]
},
"npm/webpack-batteries-included-preprocessor": {
Expand All @@ -413,27 +425,46 @@
"process",
"@babel/plugin-transform-class-properties",
"@babel/plugin-transform-object-rest-spread",
"babel-plugin-add-module-exports"
"babel-plugin-add-module-exports",
"@paths/.+"
]
},
"npm/webpack-preprocessor": {
"entry": [
"index.ts"
"index.ts",
"test/**/*.{ts,tsx,js,jsx}"
],
"project": [
"lib/**/*.{ts,tsx,js,jsx}",
"test/**/*.{ts,tsx,js,jsx}",
"*.{ts,tsx,js,jsx}"
],
"ignoreDependencies": [
"@babel/core",
"@babel/preset-env",
"babel-loader"
]
},
"npm/vite-dev-server": {
"entry": [
"cypress/e2e/**/*.{ts,tsx,js,jsx}"
],
"project": [
"src/**/*.{ts,tsx,js,jsx}",
"cypress/**/*.{ts,tsx,js,jsx}",
"*.{ts,tsx,js,jsx}"
],
"ignoreDependencies": [
"vite",
"tslib"
]
},
"npm/puppeteer": {
"project": [
"src/**/*.{ts,tsx,js,jsx}"
],
"ignoreDependencies": [
"express"
]
},
"npm/svelte": {
Expand All @@ -442,8 +473,15 @@
]
},
"npm/react": {
"entry": [
"cypress/component/**/*.{jsx,tsx,cy.jsx,cy.tsx}"
],
"project": [
"src/**/*.{ts,tsx,js,jsx}"
"src/**/*.{ts,tsx,js,jsx}",
"cypress/**/*.{ts,tsx,js,jsx}"
],
"ignoreDependencies": [
"react-router"
]
},
"npm/grep": {
Expand All @@ -452,8 +490,12 @@
]
},
"npm/vue": {
"entry": [
"cypress/component/**/*.{vue,js,ts,cy.js,cy.ts}"
],
"project": [
"src/**/*.{ts,tsx,js,jsx}",
"cypress/**/*.{vue,ts,tsx,js,jsx}",
"*.{ts,tsx,js,jsx}"
]
},
Expand All @@ -464,13 +506,30 @@
},
"npm/mount-utils": {
"project": [
"src/**/*.{ts,tsx,js,jsx}"
"src/**/*.{ts,tsx,js,jsx}",
"*.{ts,tsx,js,jsx,mjs}"
],
"ignoreDependencies": [
"@rollup/plugin-commonjs",
"@rollup/plugin-node-resolve",
"rollup",
"rollup-plugin-dts",
"rollup-plugin-typescript2",
"eslint"
]
},
"npm/vite-plugin-cypress-esm": {
"entry": [
"cypress/component/**/*.{ts,tsx,cy.ts,cy.tsx}",
"cypress.config.ts"
],
"project": [
"src/**/*.{ts,tsx,js,jsx}",
"cypress/**/*.{ts,tsx,js,jsx}",
"*.{ts,tsx,js,jsx}"
],
"ignoreDependencies": [
"react-router"
]
},
"npm/*": {
Expand Down Expand Up @@ -549,6 +608,7 @@
"**/postcss.config.{js,ts,cjs,mjs}",
"**/apollo.config.{js,ts}",
"**/webpack.config.{js,ts,mjs}",
"**/babel.config.{js,ts,cjs,mjs}",
"**/gulpfile.{js,ts}",
"scripts/**",
"**/patches/**",
Expand Down
7 changes: 5 additions & 2 deletions npm/grep/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { plugin as cypressGrepPlugin } from './src/plugin'
import assert from 'node:assert'
import path from 'path'
import fs from 'fs'
import _ from 'lodash'
import debug from 'debug'

const debugInstance = debug('cypress:grep:compare-results')
Expand Down Expand Up @@ -55,7 +54,11 @@ export default defineConfig({
debugInstance('actual results are: %o', actualArr)
debugInstance('comparing results')

assert.ok(_.isEqual(actualArr, expectedArr))
// Use JSON.stringify for deep equality comparison since both arrays are JSON-serializable
assert.strictEqual(
JSON.stringify(actualArr, null, 2),
JSON.stringify(expectedArr, null, 2),
)
} catch (error) {
if (process.env.OVERWRITE_EXPECTED) {
debugInstance('Overwriting expected results')
Expand Down
11 changes: 6 additions & 5 deletions npm/grep/cypress/e2e/each.cy.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// https://github.com/bahmutov/cypress-each
import 'cypress-each'

describe('tests that use .each work', () => {
// creating tests dynamically works with "cypress-grep"
it.each([1, 2, 3])('test for %d', (x) => {
expect(x).to.be.oneOf([1, 2, 3])
const testCases = [1, 2, 3]

testCases.forEach((x) => {
it(`test for ${x}`, () => {
expect(x).to.be.oneOf([1, 2, 3])
})
})
})
3 changes: 0 additions & 3 deletions npm/grep/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@
},
"devDependencies": {
"@packages/eslint-config": "0.0.0-development",
"cypress-each": "^1.11.0",
"cypress-expect": "^2.5.3",
"eslint": "^9.31.0",
"lodash": "^4.17.21",
"vitest": "^3.2.4",
"typescript": "~5.4.5"
},
Expand Down
6 changes: 3 additions & 3 deletions npm/mount-utils/create-rollup-entry.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import ts from 'rollup-plugin-typescript2'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import _ from 'lodash'
import mergeWith from 'lodash.mergewith'
import { readFileSync } from 'fs'
import dts from 'rollup-plugin-dts'

Expand Down Expand Up @@ -51,8 +51,8 @@ export function createEntries (options) {
},
}

const finalConfig = _.mergeWith({}, baseConfig, config, (objValue, srcValue) => {
if (_.isArray(objValue)) {
const finalConfig = mergeWith({}, baseConfig, config, (objValue, srcValue) => {
if (Array.isArray(objValue)) {
return objValue.concat(srcValue)
}
})
Expand Down
1 change: 1 addition & 0 deletions npm/mount-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"eslint": "^9.31.0",
"lodash.mergewith": "^4.6.2",
"rollup": "3.29.5",
"rollup-plugin-dts": "5.0.0",
"rollup-plugin-typescript2": "^0.29.0",
Expand Down
4 changes: 2 additions & 2 deletions npm/puppeteer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"watch": "rimraf dist && tsc --watch"
},
"dependencies": {
"lodash": "^4.17.21",
"lodash.isplainobject": "^4.0.6",
"puppeteer-core": "^21.2.1"
},
"devDependencies": {
"@packages/eslint-config": "0.0.0-development",
"@types/lodash.isplainobject": "^4.0.9",
"@types/node": "^22.18.7",
"chokidar": "^3.5.3",
"eslint": "^9.31.0",
"express": "4.21.0",
"rimraf": "^6.0.1",
Expand Down
2 changes: 1 addition & 1 deletion npm/puppeteer/src/plugin/setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isPlainObject from 'lodash/isPlainObject'
import isPlainObject from 'lodash.isplainobject'
import defaultPuppeteer, { Browser, PuppeteerNode } from 'puppeteer-core'
import { pluginError } from './util'
import { activateMainTab } from './activateMainTab'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="cypress" />
/// <reference types="../../lib" />
import React from 'react'
import { mount } from '@cypress/react'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="cypress" />
/// <reference types="../../lib" />

import React from 'react'
import { mount } from '@cypress/react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="cypress" />
/// <reference types="../../lib" />

import React from 'react'
import ReactDom from 'react-dom'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/// <reference types="../../lib" />

import React from 'react'
import ReactDom from 'react-dom'
import { mount } from '@cypress/react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="cypress" />
/// <reference types="../../lib" />
import React from 'react'
import { mount } from '@cypress/react'
import { Counter } from './counter.jsx'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="cypress" />
/// <reference types="../../lib" />
import React from 'react'
import { mount } from '@cypress/react'

Expand Down
1 change: 0 additions & 1 deletion npm/react/cypress/component/basic/hello-x.cy.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="cypress" />
/// <reference types="../../lib" />
import { HelloX } from './hello-x.jsx'
import React from 'react'
import { mount } from '@cypress/react'
Expand Down
1 change: 0 additions & 1 deletion npm/react/cypress/component/basic/mount-div/spec.cy.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="cypress" />
/// <reference types="../../lib" />
import React from 'react'
import { mount } from '@cypress/react'

Expand Down
1 change: 0 additions & 1 deletion npm/react/cypress/component/basic/network/1-users.cy.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="cypress" />
/// <reference types="../../lib" />
import { Users } from './1-users.jsx'
import React from 'react'
import { mount } from '@cypress/react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="cypress" />
/// <reference types="../../lib" />
import { Users } from './2-users-fetch.jsx'
import React from 'react'
import { mount } from '@cypress/react'
Expand Down
1 change: 0 additions & 1 deletion npm/react/cypress/component/basic/pure-component.cy.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="cypress" />
/// <reference types="../../lib" />

import React from 'react'
import Button from './pure-component.jsx'
Expand Down
1 change: 0 additions & 1 deletion npm/react/cypress/component/basic/stateless.cy.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="cypress" />
/// <reference types="../../lib" />
import HelloWorld from './stateless.jsx'
import React from 'react'
import { mount } from '@cypress/react'
Expand Down
1 change: 0 additions & 1 deletion npm/react/cypress/component/basic/transpiled.cy.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="cypress" />
/// <reference types="../../lib" />
import { Transpiled } from './transpiled.jsx'
import React from 'react'
import { mount } from '@cypress/react'
Expand Down
5 changes: 1 addition & 4 deletions npm/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
},
"devDependencies": {
"@cypress/mount-utils": "0.0.0-development",
"@types/semver": "7.7.1",
"@vitejs/plugin-react": "4.6.0",
"axios": "1.8.2",
"cypress": "0.0.0-development",
Expand All @@ -27,10 +26,8 @@
"react-router": "6.28.0",
"react-router-dom": "6.28.0",
"rollup": "3.29.5",
"semver": "^7.7.3",
"typescript": "~5.4.5",
"vite": "6.3.5",
"vite-plugin-require-transform": "1.0.21"
"vite": "6.3.5"
},
"peerDependencies": {
"@types/react": "^18 || ^19",
Expand Down
1 change: 0 additions & 1 deletion npm/vite-dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"vite-5": "npm:vite@^5.4.20",
"vite-6": "npm:vite@^6.4.0",
"vite-7": "npm:vite@^7.1.5",
"vite-plugin-inspect": "0.8.4",
"vitest": "2.1.9"
},
"peerDependencies": {
Expand Down
35 changes: 0 additions & 35 deletions npm/vue/cypress/component/tailwind/RedBox.vue

This file was deleted.

Loading
Loading