Skip to content

Regression after doesn't execute if tests skipped in beforeEach #2286

Closed

Description

after(function () {
  console.log('after outside suite')
})

describe('suite', function () {
  var count = 0

  beforeEach(function () {
    if (count > 2) this.skip()
  })

  after(function () {
    console.log('after in suite')
  })

  it('test 1', function () { ++count })
  it('test 2', function () { ++count })
  it('test 3', function () { ++count })
  it('test 4', function () { ++count })
  it('test 5', function () { ++count })
  it('test 6', function () { ++count })
})

will not output the after in suite since v2.5.0 due to PR #2081 (found via git bisect)

reported by @blueice349, confirmed by myself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    type: buga defect, confirmed by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions