-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix sourcemaps when using cy.origin() dependencies (#24367)
- Loading branch information
1 parent
7a7d16e
commit b916ba9
Showing
15 changed files
with
147 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
npm/webpack-preprocessor/patches/merge-source-map+1.1.0.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
diff --git a/node_modules/merge-source-map/index.js b/node_modules/merge-source-map/index.js | ||
index 2867fb7..efa44ed 100644 | ||
--- a/node_modules/merge-source-map/index.js | ||
+++ b/node_modules/merge-source-map/index.js | ||
@@ -47,7 +47,8 @@ function merge(oldMap, newMap) { | ||
}) | ||
}) | ||
|
||
- var consumers = [oldMapConsumer, newMapConsumer] | ||
+ // fixes https://github.com/keik/merge-source-map/issues/6 | ||
+ var consumers = [newMapConsumer, oldMapConsumer] | ||
consumers.forEach(function(consumer) { | ||
consumer.sources.forEach(function(sourceFile) { | ||
mergedMapGenerator._sources.add(sourceFile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
44 changes: 39 additions & 5 deletions
44
system-tests/projects/e2e/cypress/e2e/cy_origin_error.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,48 @@ | ||
describe('cy.origin', () => { | ||
import { fail, verify } from '../support/util' | ||
|
||
describe('cy.origin errors', () => { | ||
beforeEach(() => { | ||
// @ts-ignore | ||
window.top.__cySkipValidateConfig = true | ||
// must be interactive or stack trace is handled differently for the sake | ||
// of how it prints to stdout | ||
Cypress.config('isInteractive', true) | ||
|
||
cy.visit('/primary_origin.html') | ||
cy.get('a[data-cy="cross_origin_secondary_link"]').click() | ||
}) | ||
|
||
it('tries to find an element that doesn\'t exist and fails', () => { | ||
fail('command failure', this, () => { | ||
cy.origin('http://www.foobar.com:4466', () => { | ||
cy.get('#doesnotexist', { | ||
timeout: 1000, | ||
}) | ||
cy.get('#doesnotexist', { timeout: 1 }) | ||
}) | ||
}) | ||
|
||
verify('command failure', this, { | ||
line: 16, | ||
column: 8, | ||
message: 'Expected to find element', | ||
stack: ['cy_origin_error.cy.ts'], | ||
before () { | ||
cy.visit('/primary_origin.html') | ||
}, | ||
}) | ||
|
||
fail('failure when using dependency', this, () => { | ||
cy.origin('http://www.foobar.com:4466', () => { | ||
require('../support/util') | ||
|
||
cy.get('#doesnotexist', { timeout: 1 }) | ||
}) | ||
}) | ||
|
||
verify('failure when using dependency', this, { | ||
line: 32, | ||
column: 8, | ||
message: 'Expected to find element', | ||
stack: ['cy_origin_error.cy.ts'], | ||
before () { | ||
cy.visit('/primary_origin.html') | ||
}, | ||
}) | ||
}) |
Oops, something went wrong.
b916ba9
There was a problem hiding this comment.
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:
b916ba9
There was a problem hiding this comment.
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:
b916ba9
There was a problem hiding this comment.
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: