Skip to content

make work for cypress@7.x #269

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

JohnnyFun
Copy link
Contributor

confirmed this change makes our 34 svelte component tests work

confirmed this change makes our 34 svelte component tests work
Comment on lines +6 to +7
const specType = Cypress?.spec?.specType // this will be present for cypress@6.x, but not for cypress@7.x
if (specType != null && specType !== 'component') {
Copy link

@nwaughachukwuma nwaughachukwuma Aug 3, 2021

Choose a reason for hiding this comment

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

@bahmutov, Cypress.spec.specType is undefined here and it may suffice to use Cypress.testingType

cc @JohnnyFun

Choose a reason for hiding this comment

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

Another angle is that Cypress may no longer provide the specType attribute since it now has dedicated commands for component testing, open-ct and run-ct. And looking at the output from here, also shown below, it is safe to use Cypress.testingType

it('log spec info', () => {
  console.log(Cypress.spec)
  // {
  //   name: 'filter.spec.js',
  //   relative: 'cypress/integration/filter.spec.js',
  //   absolute: '/Users/janelane/Dev/web-app/cypress/integration/filter.spec.js',
  // }
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants