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

Test with a title as a template string is always executed #16

Closed
gfomichev opened this issue Feb 20, 2021 · 5 comments
Closed

Test with a title as a template string is always executed #16

gfomichev opened this issue Feb 20, 2021 · 5 comments

Comments

@gfomichev
Copy link

If your test title is a template string (enclosed by the backtick), it is not processed by tag filtering.
Can be reproduced in cypress-tags-example. Replace single quotes in the I am a regular test test title with backticks (`)

describe('Run tests with no tags', () => {
  it(`I am a regular test`, () => {});
});

I am a regular test test will be executed even if only CYPRESS_INCLUDE_TAGS config is set.

@annaet
Copy link
Contributor

annaet commented Feb 22, 2021

@gfomichev thanks for this report, I'll look into fixing this!

@annaet
Copy link
Contributor

annaet commented Feb 23, 2021

@gfomichev this was actually fixed in version 0.0.19, but I hadn't updated the version in cypress-tags-example so thanks for pointing that out!

If you pull down the latest code, I've updated the version and added some more example tests. I'll close this issue for now, but please let me know if you have anymore problems.

@annaet annaet closed this as completed Feb 23, 2021
@gfomichev
Copy link
Author

@annaet I'm still able to reproduce the original behavior.
If your template string doesn't contain any expression (just a string enclosed by the backtick) the test is executed.

In file integration\template_expressions.spec.ts remove ${foo} from line 4:

...
describe(`Run tests with no tags ${foo}`, () => {
  it(`I am a regular test`, () => { });             <== HERE
  it('smoke', `I am a smoke test ${foo}`, () => { });
  it('wip', `I am a wip test ${foo}`, () => { });
});
...

This I am a regular test test will be executed even if you set CYPRESS_INCLUDE_TAGS.

Could you check that, please?

@annaet
Copy link
Contributor

annaet commented Feb 24, 2021

Ah yes you're right! I've been able to recreate this, will take a look later today.

@annaet annaet reopened this Feb 24, 2021
@annaet
Copy link
Contributor

annaet commented Feb 24, 2021

Hi @gfomichev - this should be fixed now in v0.0.20.

@annaet annaet closed this as completed Feb 24, 2021
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

No branches or pull requests

2 participants