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

Regression in cypress 13: error "cy.task() must only be invoked from the spec file or support file" when cy.ts file has an apostrophe in the file name #29982

Open
t00 opened this issue Aug 6, 2024 · 1 comment
Labels
stage: needs investigating Someone from Cypress needs to look at this type: bug v12.5.0 🐛

Comments

@t00
Copy link

t00 commented Aug 6, 2024

Current behavior

When upgrading to cypress 13, all tests running cy.task() which contain an apostrophe in file name fail with the following error:

cy.task() must only be invoked from the spec file or support file

These tests were working fine in 12.

Desired behavior

No error

Test code to reproduce

Filename: cypress/e2e/Apostrophe 'test'.cy.ts

/// <reference types="cypress" />

describe('Apostrophe test', () => {

    it('Apostrophe test', () => {
        cy.task('irrelevant');
    });
});

Cypress Version

13.13.2

Node version

v18.19.0

Operating System

Linux

Debug Logs

No response

Other

No response

@jennifer-shehane
Copy link
Member

Oh...that is a good find!

Screenshot 2024-08-06 at 1 10 00 PM

@jennifer-shehane jennifer-shehane added type: bug v12.5.0 🐛 stage: needs investigating Someone from Cypress needs to look at this labels Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs investigating Someone from Cypress needs to look at this type: bug v12.5.0 🐛
Projects
None yet
Development

No branches or pull requests

2 participants