chore: fix types for modifyObstructiveCode (#23694)

* chore: fix types for modifyObstructiveCode

* add test
This commit is contained in:
Lachlan Miller
2022-09-08 04:23:00 +10:00
committed by GitHub
parent b6dad0a674
commit 35fe5b4e24
2 changed files with 12 additions and 8 deletions
+7 -7
View File
@@ -2720,6 +2720,13 @@ declare namespace Cypress {
* @default 60000
*/
pageLoadTimeout: number
/**
* Whether Cypress will search for and replace
* obstructive JS code in .js or .html files.
*
* @see https://on.cypress.io/configuration#modifyObstructiveCode
*/
modifyObstructiveCode: boolean
/**
* Time, in milliseconds, to wait for an XHR request to go out in a [cy.wait()](https://on.cypress.io/wait) command
* @default 5000
@@ -2968,13 +2975,6 @@ declare namespace Cypress {
* Whether Cypress was launched via 'cypress open' (interactive mode)
*/
isInteractive: boolean
/**
* Whether Cypress will search for and replace
* obstructive JS code in .js or .html files.
*
* @see https://on.cypress.io/configuration#modifyObstructiveCode
*/
modifyObstructiveCode: boolean
/**
* The platform Cypress is running on.
*/
+5 -1
View File
@@ -1,6 +1,6 @@
// type tests for Cypress NPM module
// https://on.cypress.io/module-api
import cypress from 'cypress'
import cypress, { defineConfig } from 'cypress'
cypress.run // $ExpectType (options?: Partial<CypressRunOptions> | undefined) => Promise<CypressRunResult | CypressFailedRunResult>
cypress.open // $ExpectType (options?: Partial<CypressOpenOptions> | undefined) => Promise<void>
@@ -51,6 +51,10 @@ cypress.run().then(results => {
}
})
const config = defineConfig({
modifyObstructiveCode: true
})
// component options
const componentConfigNextWebpack: Cypress.ConfigOptions = {
component: {