Skip to content

Commit 9413ff6

Browse files
Merge branch 'develop' into clean-stale-scripts
2 parents 35d2587 + 78779a2 commit 9413ff6

File tree

65 files changed

+2160
-2082
lines changed

Some content is hidden

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

65 files changed

+2160
-2082
lines changed

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
1-
https://on.cypress.io/changelog
1+
# Changelogs
2+
3+
- [Cypress App](https://on.cypress.io/changelog)
4+
- [`@cypress/angular`](https://github.com/cypress-io/cypress/blob/develop/npm/angular/CHANGELOG.md)
5+
- [`@cypress/create-cypress-tests`](https://github.com/cypress-io/cypress/blob/develop/npm/create-cypress-tests/CHANGELOG.md)
6+
- [`@cypress/eslint-plugin-dev`](https://github.com/cypress-io/cypress/blob/develop/npm/eslint-plugin-dev/CHANGELOG.md)
7+
- [`@cypress/mount-utils`](https://github.com/cypress-io/cypress/blob/develop/npm/mount-utils/CHANGELOG.md)
8+
- [`@cypress/react`](https://github.com/cypress-io/cypress/blob/develop/npm/react/CHANGELOG.md)
9+
- [`@cypress/react18`](https://github.com/cypress-io/cypress/blob/develop/npm/react18/CHANGELOG.md)
10+
- [`@cypress/svelte`](https://github.com/cypress-io/cypress/blob/develop/npm/svelte/CHANGELOG.md)
11+
- [`@cypress/vite-dev-server`](https://github.com/cypress-io/cypress/blob/develop/npm/vite-dev-server/CHANGELOG.md)
12+
- [`@cypress/vue`](https://github.com/cypress-io/cypress/blob/develop/npm/vue/CHANGELOG.md)
13+
- [`@cypress/vue2`](https://github.com/cypress-io/cypress/blob/develop/npm/vue2/CHANGELOG.md)
14+
- [`@cypress/webpack-batteries-included-preprocessor`](https://github.com/cypress-io/cypress/blob/develop/npm/webpack-batteries-included-preprocessor/CHANGELOG.md)
15+
- [`@cypress/webpack-dev-server`](https://github.com/cypress-io/cypress/blob/develop/npm/webpack-dev-server/CHANGELOG.md)
16+
- [`@cypress/webpack-preprocessor`](https://github.com/cypress-io/cypress/blob/develop/npm/webpack-preprocessor/CHANGELOG.md)
17+
- [`@cypress/xpath`](https://github.com/cypress-io/cypress/blob/develop/npm/xpath/CHANGELOG.md)

CONTRIBUTING.md

Lines changed: 19 additions & 129 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ yarn add cypress --dev
6767

6868
Please see our [Contributing Guideline](./CONTRIBUTING.md) which explains repo organization, linting, testing, and other steps.
6969

70+
## How we work
71+
72+
At Cypress we value our community and strive to be as open and transparent with them as possible. Check out [our guide](./cypress-prioritization-and-triage.md) on how we prioritize community issues.
73+
7074
## License
7175

7276
[![license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cypress-io/cypress/blob/develop/LICENSE)

cli/types/cypress.d.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3073,18 +3073,21 @@ declare namespace Cypress {
30733073

30743074
type DevServerFn<ComponentDevServerOpts = any> = (cypressDevServerConfig: DevServerConfig, devServerConfig: ComponentDevServerOpts) => ResolvedDevServerConfig | Promise<ResolvedDevServerConfig>
30753075

3076+
type ConfigHandler<T> = T
3077+
| (() => T | Promise<T>)
3078+
30763079
type DevServerConfigOptions = {
30773080
bundler: 'webpack'
30783081
framework: 'react' | 'vue' | 'vue-cli' | 'nuxt' | 'create-react-app' | 'next' | 'svelte'
3079-
webpackConfig?: PickConfigOpt<'webpackConfig'>
3082+
webpackConfig?: ConfigHandler<PickConfigOpt<'webpackConfig'>>
30803083
} | {
30813084
bundler: 'vite'
30823085
framework: 'react' | 'vue' | 'svelte'
3083-
viteConfig?: Omit<Exclude<PickConfigOpt<'viteConfig'>, undefined>, 'base' | 'root'>
3086+
viteConfig?: ConfigHandler<Omit<Exclude<PickConfigOpt<'viteConfig'>, undefined>, 'base' | 'root'>>
30843087
} | {
30853088
bundler: 'webpack',
30863089
framework: 'angular',
3087-
webpackConfig?: PickConfigOpt<'webpackConfig'>,
3090+
webpackConfig?: ConfigHandler<PickConfigOpt<'webpackConfig'>>,
30883091
options?: {
30893092
projectConfig: AngularDevServerProjectConfig
30903093
}
@@ -5492,6 +5495,7 @@ declare namespace Cypress {
54925495
extensions: string[]
54935496
preferences: { [key: string]: any }
54945497
args: string[]
5498+
env: { [key: string]: any }
54955499
}
54965500

54975501
interface Dimensions {

cli/types/tests/plugins-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const pluginConfig2: Cypress.PluginConfig = (on, config) => {
1919
browser.displayName // $ExpectType string
2020
options.extensions // $ExpectType string[]
2121
options.args // $ExpectType string[]
22+
options.env // $ExpectType { [key: string]: any; }
2223

2324
console.log('launching browser', browser.displayName)
2425
return options

cypress-prioritization-and-triage.md

Lines changed: 139 additions & 0 deletions
Large diffs are not rendered by default.

npm/angular/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# [@cypress/angular-v1.1.0](https://github.com/cypress-io/cypress/compare/@cypress/angular-v1.0.0...@cypress/angular-v1.1.0) (2022-09-23)
2+
3+
4+
### Bug Fixes
5+
6+
* angular 14.2 mount compilation error ([#23593](https://github.com/cypress-io/cypress/issues/23593)) ([2f337db](https://github.com/cypress-io/cypress/commit/2f337dbfa2bb212754c8fa82e3f4548a2f3a07a4))
7+
* Fix missing `it.skip` function in Angular tests ([#23829](https://github.com/cypress-io/cypress/issues/23829)) ([64c0f45](https://github.com/cypress-io/cypress/commit/64c0f45182456bd43f4b64b2311e816dde615236))
8+
9+
10+
### Features
11+
12+
* adding svelte component testing support ([#23553](https://github.com/cypress-io/cypress/issues/23553)) ([f6eaad4](https://github.com/cypress-io/cypress/commit/f6eaad40e1836fa9db87c60defa5ae6f390c8fd8))
13+
114
# [@cypress/angular-v1.1.0](https://github.com/cypress-io/cypress/compare/@cypress/angular-v1.0.0...@cypress/angular-v1.1.0) (2022-08-30)
215

316

npm/vite-dev-server/cypress/e2e/vite-dev-server.cy.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,20 @@ describe('Config options', () => {
5858
cy.waitForSpecToFinish()
5959
cy.get('.passed > .num').should('contain', 1)
6060
})
61+
62+
it('supports viteConfig as an async function', () => {
63+
cy.scaffoldProject('vite2.9.1-react')
64+
cy.openProject('vite2.9.1-react', ['--config-file', 'cypress-vite-async-function-config.config.ts'])
65+
cy.startAppServer('component')
66+
67+
cy.visitApp()
68+
cy.contains('App.cy.jsx').click()
69+
cy.waitForSpecToFinish()
70+
cy.get('.passed > .num').should('contain', 1)
71+
cy.withCtx(async (ctx) => {
72+
const verifyFile = await ctx.file.readFileInProject('wrote-to-file')
73+
74+
expect(verifyFile).to.eq('OK')
75+
})
76+
})
6177
})

npm/vite-dev-server/src/devServer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
import debugFn from 'debug'
2+
import type { InlineConfig, UserConfig } from 'vite'
23
import { getVite, Vite } from './getVite'
34
import { createViteDevServerConfig } from './resolveConfig'
45

56
const debug = debugFn('cypress:vite-dev-server:devServer')
67

78
const ALL_FRAMEWORKS = ['react', 'vue'] as const
89

10+
type ConfigHandler = UserConfig | (() => UserConfig | Promise<UserConfig>)
11+
912
export type ViteDevServerConfig = {
1013
specs: Cypress.Spec[]
1114
cypressConfig: Cypress.PluginConfigOptions
1215
devServerEvents: NodeJS.EventEmitter
1316
onConfigNotFound?: (devServer: 'vite', cwd: string, lookedIn: string[]) => void
1417
} & {
1518
framework?: typeof ALL_FRAMEWORKS[number] // Add frameworks here as we implement
16-
viteConfig?: unknown // Derived from the user's webpack
19+
viteConfig?: ConfigHandler // Derived from the user's vite config
1720
}
1821

1922
export async function devServer (config: ViteDevServerConfig): Promise<Cypress.ResolvedDevServerConfig> {

npm/vite-dev-server/src/resolveConfig.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import debugFn from 'debug'
77
import { importModule } from 'local-pkg'
88
import { relative, resolve } from 'pathe'
9-
import type { InlineConfig } from 'vite'
9+
import type { InlineConfig, UserConfig } from 'vite'
1010
import path from 'path'
1111

1212
import { configFiles } from './constants'
@@ -90,7 +90,15 @@ export const createViteDevServerConfig = async (config: ViteDevServerConfig, vit
9090
].filter((p) => p != null),
9191
}
9292

93-
const finalConfig = vite.mergeConfig(viteBaseConfig, viteOverrides as Record<string, any>)
93+
let resolvedOverrides: UserConfig = {}
94+
95+
if (typeof viteOverrides === 'function') {
96+
resolvedOverrides = await viteOverrides()
97+
} else if (typeof viteOverrides === 'object') {
98+
resolvedOverrides = viteOverrides
99+
}
100+
101+
const finalConfig = vite.mergeConfig(viteBaseConfig, resolvedOverrides)
94102

95103
debug('The resolved server config is', JSON.stringify(finalConfig, null, 2))
96104

0 commit comments

Comments
 (0)