Skip to content

Commit

Permalink
Merge branch 'develop' into tgriesser/spike/spike
Browse files Browse the repository at this point in the history
* develop: (45 commits)
  fix: re-enable CYPRESS_INTERNAL_VITE_DEV development (#25364)
  fix: add skip domain injection description (#25463)
  fix: revert CSP header and script-src addition (#25445)
  chore: Update v8 snapshot cache (#25401)
  feat: Do not strip CSP headers from HTTPResponse (#24760)
  fix: keep spaces in formatted output in test runner (#24687)
  fix: Restrict dependency versions to known supported ranges (#25380)
  chore: Update v8 snapshot cache (#25370)
  feat: experimental skip domain injection (#25307)
  chore: support vite v4 for component testing (#25365)
  feat: Use JSX/TSX in generated spec filenames (#25318)
  docs(angular): Properties that are spied upon have to be defined within `componentProperties` instead of on root level. (#25359)
  chore: remove lint-changed from scripts/docs (#25308)
  chore: bump to 12.3.0 [skip ci] (#25355)
  fix: make NODE_ENV "production" for prod builds of launchpad (#25320)
  fix: .contains() should only return one element at all times (#25250)
  feat: add currentRetry to Cypress API (#25297)
  chore: release @cypress/webpack-dev-server-v3.2.2
  chore: release create-cypress-tests-v2.0.1
  fix: change wording for spec creation (#25271)
  ...
  • Loading branch information
tgriesser committed Jan 18, 2023
2 parents 04a734a + 991c532 commit 3e305cd
Show file tree
Hide file tree
Showing 256 changed files with 4,313 additions and 4,379 deletions.
20 changes: 4 additions & 16 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ mainBuildFilters: &mainBuildFilters
only:
- develop
- /^release\/\d+\.\d+\.\d+$/
- 'retry-flake'
- 'macOS-launch-arm-browser'

# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
Expand All @@ -37,15 +37,15 @@ macWorkflowFilters: &darwin-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ 'retry-flake', << pipeline.git.branch >> ]
- equal: [ 'macOS-launch-arm-browser', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ 'retry-flake', << pipeline.git.branch >> ]
- equal: [ 'macOS-launch-arm-browser', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand Down Expand Up @@ -129,7 +129,7 @@ commands:
- run:
name: Check current branch to persist artifacts
command: |
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "retry-flake" ]]; then
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "macOS-launch-arm-browser" ]]; then
echo "Not uploading artifacts or posting install comment for this branch."
circleci-agent step halt
fi
Expand Down Expand Up @@ -2680,12 +2680,6 @@ darwin-x64-workflow: &darwin-x64-workflow
requires:
- darwin-x64-node-modules-install

- lint:
name: darwin-x64-lint
executor: mac
requires:
- darwin-x64-build

- create-build-artifacts:
name: darwin-x64-create-build-artifacts
context:
Expand Down Expand Up @@ -2775,12 +2769,6 @@ windows-workflow: &windows-workflow
requires:
- windows-build

- lint:
name: windows-lint
executor: windows
requires:
- windows-build

- unit-tests:
name: windows-unit-tests
executor: windows
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const validators = specifiedRules
)

module.exports = {
root: true,
plugins: [
'@cypress/dev',
'graphql',
Expand Down
10 changes: 2 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,8 @@ Many Cypress packages print out debugging information to console via the `debug`
We use [eslint](https://eslint.org/) to lint all JavaScript code and follow rules specified in
[@cypress/eslint-plugin-dev](./npm/eslint-plugin-cypress) plugin.

When you edit files, you can quickly fix all changed files before you commit using

```bash
$ yarn lint-changed --fix
```

When committing files, we run a Git pre-commit hook to lint the staged JS files. See the [`lint-staged` project](https://github.com/okonet/lint-staged).
If this command fails, you may need to run `yarn lint-changed --fix` and commit those changes.
This project uses a Git pre-commit hook to lint staged files before committing. See the [`lint-staged` project](https://github.com/okonet/lint-staged) for details.
`lint-staged` will try to auto-fix any lint errors with `eslint --fix`, so if it fails, you must manually fix the lint errors before committing.

We **DO NOT** use Prettier to format code. You can find [.prettierignore](.prettierignore) file that ignores all files in this repository. To ensure this file is loaded, please always open _the root repository folder_ in your text editor, otherwise your code formatter might execute, reformatting lots of source files.

Expand Down
1 change: 0 additions & 1 deletion cli/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"extends": "../.eslintrc.js",
"rules": {
"no-restricted-syntax": [
"error",
Expand Down
5 changes: 0 additions & 5 deletions cli/test/lib/exec/.eslintrc.json

This file was deleted.

15 changes: 15 additions & 0 deletions cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@ declare namespace Cypress {
titlePath: string[]
}

/**
* Information about current test retry
*/
currentRetry: number

/**
* Information about the browser currently running the tests
*/
Expand Down Expand Up @@ -3014,6 +3019,16 @@ declare namespace Cypress {
* @see https://on.cypress.io/configuration#experimentalModifyObstructiveThirdPartyCode
*/
experimentalModifyObstructiveThirdPartyCode: boolean
/**
* Disables setting document.domain to the applications super domain on injection.
* This experiment is to be used for sites that do not work with setting document.domain
* due to cross-origin issues. Enabling this option no longer allows for default subdomain
* navigations, and will require the use of cy.origin(). This option takes an array of
* strings/string globs.
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/domain
* @default null
*/
experimentalSkipDomainInjection: string[] | null
/**
* Enables AST-based JS/HTML rewriting. This may fix issues caused by the existing regex-based JS/HTML replacement algorithm.
* @default false
Expand Down
11 changes: 1 addition & 10 deletions npm/angular/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,5 @@
],
"extends": [
"plugin:@cypress/dev/tests"
],
"env": {
"cypress/globals": true
},
"rules": {
"mocha/no-global-tests": "off",
"no-unused-vars": "off",
"no-console": "off",
"@typescript-eslint/no-unused-vars": "off"
}
]
}
2 changes: 1 addition & 1 deletion npm/angular/src/mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export function mount<T> (
* import { mount, createOutputSpy } from '@cypress/angular'
*
* it('Has spy', () => {
* mount(StepperComponent, { change: createOutputSpy('changeSpy') })
* mount(StepperComponent, { componentProperties: { change: createOutputSpy('changeSpy') } })
* cy.get('[data-cy=increment]').click()
* cy.get('@changeSpy').should('have.been.called')
* })
Expand Down
26 changes: 2 additions & 24 deletions npm/create-cypress-tests/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,10 @@
"plugin:@cypress/dev/general",
"plugin:@cypress/dev/tests"
],
"parser": "@typescript-eslint/parser",
"env": {
"cypress/globals": true
},
"rules": {
"no-console": "off",
"mocha/no-global-tests": "off",
"@typescript-eslint/no-unused-vars": "off"
},
"overrides": [
{
"files": [
"lib/*"
],
"rules": {
"no-console": 1
}
},
{
"files": [
"**/*.json"
],
"rules": {
"quotes": "off",
"comma-dangle": "off"
}
}
]
"no-console": "off"
}
}
7 changes: 7 additions & 0 deletions npm/create-cypress-tests/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [create-cypress-tests-v2.0.1](https://github.com/cypress-io/cypress/compare/create-cypress-tests-v2.0.0...create-cypress-tests-v2.0.1) (2023-01-03)


### Bug Fixes

* change wording for spec creation ([#25271](https://github.com/cypress-io/cypress/issues/25271)) ([c12a7e3](https://github.com/cypress-io/cypress/commit/c12a7e37c73d972eb0514e4b602940df210d86c7))

# [create-cypress-tests-v2.0.0](https://github.com/cypress-io/cypress/compare/create-cypress-tests-v1.3.0...create-cypress-tests-v2.0.0) (2022-06-13)


Expand Down
2 changes: 1 addition & 1 deletion npm/create-cypress-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Here is a list of available configuration options:

`--use-npm` – use npm if yarn available
`--ignore-typescript` – will not create typescript configuration if available
`--ignore-examples` – will create a 1 empty spec file (`cypress/integration/spec.js`) to start with
`--ignore-examples` – will create a 1 template spec file (`cypress/integration/spec.js`) to start with
`--component-tests` – will not ask should setup component testing or not

## License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/// <reference path="../../../../../cli/types/mocha/index.d.ts" />

import * as path from 'path'
import { expect } from 'chai'

import * as fs from 'fs-extra'
import { insertValueInJSString, insertValuesInConfigFile } from './configFileUpdater'
const projectRoot = process.cwd()
import { insertValueInJSString } from './configFileUpdater'

// Test util - if needed outside the tests we can move it to utils
const stripIndent = (strings: any, ...args: any) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import _ from 'lodash'
import { parse } from '@babel/parser'
import type { File } from '@babel/types'
import type { NodePath } from 'ast-types/lib/node-path'
Expand Down
3 changes: 1 addition & 2 deletions npm/eslint-plugin-dev/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
"extends": [
"plugin:promise/recommended",
"plugin:@cypress/dev/general"
],
"rules": {}
]
}
5 changes: 0 additions & 5 deletions npm/eslint-plugin-dev/lib/scripts/.eslintrc.json

This file was deleted.

6 changes: 0 additions & 6 deletions npm/eslint-plugin-dev/test/fixtures/.eslintrc

This file was deleted.

4 changes: 1 addition & 3 deletions npm/grep/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
},
"rules": {
"mocha/no-global-tests": "off",
"no-unused-vars": "off",
"no-console": "off",
"@typescript-eslint/no-unused-vars": "off",
"no-restricted-syntax": "off"
}
}
}
2 changes: 1 addition & 1 deletion npm/grep/cypress/e2e/nested-describe-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('grand', () => {
describe('top', { tags: '@smoke' }, () => {
describe('middle', () => {
context('bottom', { tags: ['@integration', '@fast'] }, () => {
it('runs too', () => {});
it('runs too', () => {})
})
})
})
1 change: 1 addition & 0 deletions npm/grep/cypress/e2e/omit-and-skip-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// @ts-check
describe('Page', () => {
describe('List', { tags: ['@us1'] }, () => {
// eslint-disable-next-line @cypress/dev/skip-comment
it.skip('first test', () => {})
it('second test', () => {})
it('third test', () => {})
Expand Down
1 change: 1 addition & 0 deletions npm/grep/cypress/e2e/skip-spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @cypress/dev/skip-comment */
/// <reference types="cypress" />
describe('tests that use .skip', () => {
// use a template literal
Expand Down
2 changes: 2 additions & 0 deletions npm/grep/cypress/e2e/ts-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('TypeScript spec', () => {

it('loads', () => {
const n: number = 1

cy.wrap(n).should('eq', 1)
})

Expand All @@ -24,6 +25,7 @@ describe('TypeScript spec', () => {
const p: Person = {
name: 'Joe',
}

cy.wrap(p).should('have.property', 'name', 'Joe')
})
})
3 changes: 2 additions & 1 deletion npm/grep/cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/// <reference types="cypress" />

import cypressGrep from '../../src/support'

// register the grep feature
// https://github.com/cypress-io/cypress-grep
cypressGrep()
cypressGrep()
3 changes: 2 additions & 1 deletion npm/grep/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "src/support.js",
"scripts": {
"cy:run": "node ../../scripts/cypress.js run --config specPattern='**/unit.js'",
"cy:open": "node ../../scripts/cypress.js open --e2e -b electron --config specPattern='**/unit.js'"
"cy:open": "node ../../scripts/cypress.js open --e2e -b electron --config specPattern='**/unit.js'",
"lint": "eslint . --ext .js,.ts"
},
"dependencies": {
"debug": "^4.3.2",
Expand Down
22 changes: 1 addition & 21 deletions npm/react/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"rules": {
"no-console": "off",
"mocha/no-global-tests": "off",
"@typescript-eslint/no-unused-vars": "off",
"react/jsx-filename-extension": [
"warn",
{
Expand All @@ -30,24 +29,5 @@
]
}
]
},
"overrides": [
{
"files": [
"lib/*"
],
"rules": {
"no-console": 1
}
},
{
"files": [
"**/*.json"
],
"rules": {
"quotes": "off",
"comma-dangle": "off"
}
}
]
}
}
1 change: 1 addition & 0 deletions npm/react/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
},
'experimentalFetchPolyfill': true,
'component': {
experimentalSingleTabRunMode: true,
'excludeSpecPattern': [
'**/__snapshots__/*',
'**/__image_snapshots__/*',
Expand Down
4 changes: 1 addition & 3 deletions npm/svelte/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
},
"rules": {
"mocha/no-global-tests": "off",
"no-unused-vars": "off",
"no-console": "off",
"@typescript-eslint/no-unused-vars": "off"
"no-console": "off"
}
}
2 changes: 1 addition & 1 deletion npm/svelte/src/mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const cleanup = () => {
// Extract the component name from the object passed to mount
const getComponentDisplayName = <T extends SvelteComponent>(Component: SvelteConstructor<T>): string => {
if (Component.name) {
const [_, match] = /Proxy\<(\w+)\>/.exec(Component.name) || []
const [, match] = /Proxy\<(\w+)\>/.exec(Component.name) || []

return match || Component.name
}
Expand Down
Loading

0 comments on commit 3e305cd

Please sign in to comment.