Skip to content

Commit d61174f

Browse files
authored
Handle cypress error coming from 3rd party lib (#14702)
1 parent 65d9ec7 commit d61174f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

cypress/e2e/site.cy.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* Handle uncaught exceptions from third-party scripts.
3+
*
4+
* The vector.co pixel.js script throws an uncaught exception when it detects a cloud provider environment.
5+
* This happens in the GitHub Actions runner but not locally, causing tests to fail in CI.
6+
*
7+
* We catch and ignore this specific error while still allowing other legitimate errors to fail the tests.
8+
*/
9+
Cypress.on('uncaught:exception', (err) => {
10+
// Return false to prevent the error from failing the test
11+
if (err.message.includes('Cloud provider detected')) {
12+
return false;
13+
}
14+
// Return true for other errors to fail the test
15+
return true;
16+
});
17+
118
describe("www.pulumi.com", () => {
219

320
describe("home page", () => {

0 commit comments

Comments
 (0)