Skip to content

Should before and after run with skip? #1283

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

Closed
unional opened this issue Feb 23, 2017 · 2 comments · Fixed by #1570
Closed

Should before and after run with skip? #1283

unional opened this issue Feb 23, 2017 · 2 comments · Fixed by #1570
Labels
bug current functionality does not work as desired help wanted scope:test-interface

Comments

@unional
Copy link

unional commented Feb 23, 2017

ava: 0.18.2

import test from 'ava'

test.before(() => {
  throw new Error('should not run?')
})
test.after(() => {
  throw new Error('should not run?')
})

test.skip('some skipped test', t => { })

Currently the before() and after() is run even if the file contain only skipped tests.
Is that the expected behavior?

@novemberborn
Copy link
Member

Interesting. I don't particularly mind to be honest, it's a bit of an edge case. What do you think?

@sindresorhus
Copy link
Member

As a user, I would expect them to not run. Same with beforeEach and afterEach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug current functionality does not work as desired help wanted scope:test-interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants