Skip to content

Commit

Permalink
Merge branch 'develop' into webkit-experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Sep 8, 2022
2 parents 91357ed + 3841292 commit dc21b48
Show file tree
Hide file tree
Showing 15 changed files with 354 additions and 486 deletions.
14 changes: 7 additions & 7 deletions cli/types/cypress.d.ts
Expand Up @@ -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
Expand Down Expand Up @@ -2973,13 +2980,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.
*/
Expand Down
6 changes: 5 additions & 1 deletion cli/types/tests/cypress-npm-api-test.ts
@@ -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>
Expand Down Expand Up @@ -51,6 +51,10 @@ cypress.run().then(results => {
}
})

const config = defineConfig({
modifyObstructiveCode: true
})

// component options
const componentConfigNextWebpack: Cypress.ConfigOptions = {
component: {
Expand Down
2 changes: 1 addition & 1 deletion npm/vite-dev-server/package.json
Expand Up @@ -26,7 +26,7 @@
"dedent": "^0.7.0",
"mocha": "^9.2.2",
"sinon": "^13.0.1",
"ts-node": "^10.2.1",
"ts-node": "^10.9.1",
"vite": "3.0.3",
"vite-plugin-inspect": "0.4.3"
},
Expand Down
2 changes: 1 addition & 1 deletion npm/webpack-dev-server/package.json
Expand Up @@ -37,7 +37,7 @@
"proxyquire": "2.1.3",
"sinon": "^13.0.1",
"snap-shot-it": "^7.9.6",
"ts-node": "^10.2.1",
"ts-node": "^10.9.1",
"webpack": "npm:webpack@^5",
"webpack-4": "npm:webpack@^4",
"webpack-dev-server-3": "npm:webpack-dev-server@^3"
Expand Down
2 changes: 1 addition & 1 deletion npm/webpack-preprocessor/package.json
Expand Up @@ -58,7 +58,7 @@
"sinon": "^9.0.0",
"sinon-chai": "^3.5.0",
"snap-shot-it": "7.9.2",
"ts-node": "^10.2.1",
"ts-node": "^10.9.1",
"webpack": "^4.44.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -214,7 +214,7 @@
"through": "2.3.8",
"through2": "^4.0.2",
"tree-kill": "1.2.2",
"ts-node": "^10.2.1",
"ts-node": "^10.9.1",
"typescript": "^4.7.4",
"yarn-deduplicate": "3.1.0"
},
Expand Down
5 changes: 5 additions & 0 deletions packages/data-context/src/data/ProjectConfigIpc.ts
Expand Up @@ -271,7 +271,9 @@ export class ProjectConfigIpc extends EventEmitter {
// ts-node for CommonJS
// ts-node/esm for ESM
if (hasTypeScriptInstalled(this.projectRoot)) {
debug('found typescript in %s', this.projectRoot)
if (isProjectUsingESModules) {
debug(`using --experimental-specifier-resolution=node with --loader ${tsNodeEsm}`)
// Use the ts-node/esm loader so they can use TypeScript with `"type": "module".
// The loader API is experimental and will change.
// The same can be said for the other alternative, esbuild, so this is the
Expand All @@ -294,6 +296,8 @@ export class ProjectConfigIpc extends EventEmitter {
// so we need to load and evaluate the hook first using the `--require` module API.
const tsNodeLoader = `--require "${tsNode}"`

debug(`using cjs with --require ${tsNode}`)

if (childOptions.env.NODE_OPTIONS) {
childOptions.env.NODE_OPTIONS += ` ${tsNodeLoader}`
} else {
Expand All @@ -303,6 +307,7 @@ export class ProjectConfigIpc extends EventEmitter {
} else {
// Just use Node's built-in ESM support.
// TODO: Consider using userland `esbuild` with Node's --loader API to handle ESM.
debug(`no typescript found, just use regular Node.js`)
}

return fork(CHILD_PROCESS_FILE_PATH, configProcessArgs, childOptions)
Expand Down
11 changes: 10 additions & 1 deletion packages/server/lib/modes/run.ts
Expand Up @@ -621,6 +621,11 @@ async function waitForTestsToFinishRunning (options: { project: Project, screens

results.shouldUploadVideo = shouldUploadVideo

if (!shouldUploadVideo) {
debug(`Spec run had no failures and config.videoUploadOnPasses=false. Skip processing video. Video path: ${videoName}`)
results.video = null
}

if (!quiet && !skippedSpec) {
printResults.displayResults(results, estimated)
}
Expand Down Expand Up @@ -660,10 +665,15 @@ async function waitForTestsToFinishRunning (options: { project: Project, screens
},
})
} catch (err) {
videoCaptureFailed = true
warnVideoRecordingFailed(err)
}
}

if (videoCaptureFailed) {
results.video = null
}

return results
}

Expand Down Expand Up @@ -866,7 +876,6 @@ async function runSpec (config, spec: SpecWithRelativeRoot, options: { project:
quiet: options.quiet,
shouldKeepTabOpen: !isLastSpec,
}),

waitForBrowserToConnect({
spec,
project,
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Expand Up @@ -116,7 +116,7 @@
"tough-cookie": "4.0.0",
"trash": "5.2.0",
"tree-kill": "1.2.2",
"ts-node": "^10.2.1",
"ts-node": "^10.9.1",
"tslib": "2.3.1",
"underscore.string": "3.3.5",
"url-parse": "1.5.9",
Expand Down
2 changes: 1 addition & 1 deletion packages/ts/package.json
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"debug": "^4.3.2",
"ts-node": "^10.2.1",
"ts-node": "^10.9.1",
"tslib": "2.3.1",
"typescript-cached-transpile": "^0.0.6"
},
Expand Down

5 comments on commit dc21b48

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on dc21b48 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/linux-x64/webkit-experimental-dc21b48d361cf392b420e59f50eefd6a1a0c8296/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on dc21b48 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/linux-arm64/webkit-experimental-dc21b48d361cf392b420e59f50eefd6a1a0c8296/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on dc21b48 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/darwin-arm64/webkit-experimental-dc21b48d361cf392b420e59f50eefd6a1a0c8296/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on dc21b48 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/darwin-x64/webkit-experimental-dc21b48d361cf392b420e59f50eefd6a1a0c8296/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on dc21b48 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/win32-x64/webkit-experimental-dc21b48d361cf392b420e59f50eefd6a1a0c8296/cypress.tgz

Please sign in to comment.