Skip to content

o.before() within a o.spec still runs even when no tests are running #61

Open
@gilbert

Description

@gilbert
const o = require('ospec')

o.spec('Example', () => {
  o.before(() => {
    console.log("RUNNING BEFORE")
  })

  o('test1', () => {
    o(true).equals(true)
  })
})

o.only('test2', () => {
  o(true).equals(true)
})

In this example, the console log runs even though no test in that spec is running (due to the .only on test2). In my own project this is causing extra debug statements to show up in the console even though they're not relevant to the test I'm focusing on.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions