question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Before() is executed even if it's parent is filtered out

See original GitHub issue

With this spec file:

describe('Cypress grep', {
  tags: '@smoke'
}, () => {
  before(() => {
      expect(false).to.equal(true)
  })
  it('succeeds', () => {
    expect(true).to.equal(true)
  })
})

When executing cypress with --env grepTags=-@smoke, the test fails because the before() function is executed even though the whole describe is not supposed to be executed.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:13
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
wmedalicommented, Sep 20, 2021

This issue is also reproductible for after() hook

2reactions
nicolajvcommented, Nov 4, 2021

We upgraded to the new version since grepOmitFiltered actually works to bypass this issue: https://github.com/cypress-io/cypress-grep/pull/84

Read more comments on GitHub >

github_iconTop Results From Across the Web

Before() is executed even if it's parent is filtered out #24448
When executing cypress with --env grepTags=-@smoke , the test fails because the before() function is executed even though the whole describe is ...
Read more >
Why is Cypress saying my element is detached after just ...
Question: I can see in the DOM that this element is still present - there is no logic that will detach this element...
Read more >
Considerations for Lookup Filters - Salesforce Help
As a workaround, we recommend doing lookup filter validation for a record's fields before changing the record's owner. Spanning Relationships in Lookup Filters....
Read more >
git-filter-branch Documentation - Git
If you still need to use git filter-branch, please carefully read SAFETY ... real filter executed for each commit but a one time...
Read more >
Array.prototype.filter() - JavaScript - MDN Web Docs
The filter() method creates a shallow copy of a portion of a given ... not even obtained as it's been popped off 'words'...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found