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

Throws error on Cypress.log without previous command #3658

Open
bahmutov opened this Issue Mar 6, 2019 · 2 comments

Comments

3 participants
@bahmutov
Copy link
Collaborator

bahmutov commented Mar 6, 2019

Cypress 3.1.5 on Mac

/// <reference types="cypress" />
it('works', () => {
  Cypress.log('after hook')
})

Throws error
screen shot 2019-03-06 at 12 05 52 pm

Code that throws

    _.defaults(obj, current != null ? current.pick("name", "type") : void 0);
    if (!parentOrChildRe.test(obj.type)) {
      obj.type = current.hasPreviouslyLinkedCommand() ? "child" : "parent";
    }

https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/cypress/log.coffee#L117

@louise-hayes

This comment has been minimized.

Copy link
Contributor

louise-hayes commented Mar 8, 2019

I'd like to try resolve this?

@bahmutov

This comment has been minimized.

Copy link
Collaborator Author

bahmutov commented Mar 8, 2019

sure, try @louise-hayes and if I may suggest

  • write a test that is initially failing
  • add a guard around the failing line to fix the failing test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.