Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asynchronous stack traces point to internal Cypress code #16276

Closed
kpittman-securus opened this issue Apr 29, 2021 · 2 comments
Closed

Asynchronous stack traces point to internal Cypress code #16276

kpittman-securus opened this issue Apr 29, 2021 · 2 comments
Labels
stage: proposal 💡 No work has been done of this issue stale no activity on this issue for a long period type: error message

Comments

@kpittman-securus
Copy link

kpittman-securus commented Apr 29, 2021

Current behavior

If I have async code in a Cypress test and it fails, the stack trace points to internal Cypress code instead of application code.

Desired behavior

The stack trace should be more similar to a normal Mocha trace, which would point to the line of the error even if it's async code.

Test code to reproduce

describe("Cypress has stack traces...", () => {
  it("the synchronous ones are great!", () => {
    throw new Error("Find me!");
  });

  it("the async ones are quite opaque", () => {
    cy.wrap(null).then(async () => {
      // this is just an example...
      await fetch("https://github.com/this/does/not/exist", { method: "GET" });
    });
  });
});

image

at Context.thenFn (http://localhost:60266/__cypress/runner/cypress_runner.js:135863:24)
    at Context.then (http://localhost:60266/__cypress/runner/cypress_runner.js:136302:22)
    at Context.<anonymous> (http://localhost:60266/__cypress/runner/cypress_runner.js:151059:22)
    at <unknown> (http://localhost:60266/__cypress/runner/cypress_runner.js:150467:16)
From previous event:
    at runCommand (http://localhost:60266/__cypress/runner/cypress_runner.js:150446:9)
    at next (http://localhost:60266/__cypress/runner/cypress_runner.js:150592:15)
    at <unknown> (http://localhost:60266/__cypress/runner/cypress_runner.js:150620:17)
From previous event:
    at next (http://localhost:60266/__cypress/runner/cypress_runner.js:150592:35)
From previous event:
    at <unknown> (http://localhost:60266/__cypress/runner/cypress_runner.js:150633:38)
From previous event:
    at run (http://localhost:60266/__cypress/runner/cypress_runner.js:150626:22)
    at $Cy.cy.<computed> [as wrap] (http://localhost:60266/__cypress/runner/cypress_runner.js:151099:12)
    at Context.runnable.fn (http://localhost:60266/__cypress/runner/cypress_runner.js:151323:22)
    at callFn (http://localhost:60266/__cypress/runner/cypress_runner.js:107502:22)
    at Test.../driver/node_modules/mocha/lib/runnable.js.Runnable.run (http://localhost:60266/__cypress/runner/cypress_runner.js:107489:8)
    at <unknown> (http://localhost:60266/__cypress/runner/cypress_runner.js:157280:29)
From previous event:
    at Object.onRunnableRun (http://localhost:60266/__cypress/runner/cypress_runner.js:157268:18)
    at $Cypress.action (http://localhost:60266/__cypress/runner/cypress_runner.js:147407:29)
    at Test.Runnable.run (http://localhost:60266/__cypress/runner/cypress_runner.js:155410:14)
    at Runner.../driver/node_modules/mocha/lib/runner.js.Runner.runTest (http://localhost:60266/__cypress/runner/cypress_runner.js:108161:11)
    at <unknown> (http://localhost:60266/__cypress/runner/cypress_runner.js:108287:13)
    at next (http://localhost:60266/__cypress/runner/cypress_runner.js:108070:15)
    at <unknown> (http://localhost:60266/__cypress/runner/cypress_runner.js:108080:8)
    at next (http://localhost:60266/__cypress/runner/cypress_runner.js:107982:15)
    at <unknown> (http://localhost:60266/__cypress/runner/cypress_runner.js:108048:6)
    at timeslice (http://localhost:60266/__cypress/runner/cypress_runner.js:101974:28)

Versions

Cypress 7.2.0

@jennifer-shehane
Copy link
Member

Yah, this could be better probably. Related to #7202

@jennifer-shehane jennifer-shehane added type: error message stage: proposal 💡 No work has been done of this issue labels Apr 30, 2021
@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label May 17, 2023
@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: proposal 💡 No work has been done of this issue stale no activity on this issue for a long period type: error message
Projects
None yet
Development

No branches or pull requests

3 participants