Skip to content

Improvements to hook methods

Compare
Choose a tag to compare
@thetutlage thetutlage released this 18 Oct 12:32
· 17 commits to develop since this release

The hook methods like suite.onGroup, suite.onTest, group.tap, and runner.onSuite used to execute for newly added instances to the respective classes. After this release, the hooks will be executed for pre-registered instances as well.

const test = new Test(...args)
const test1 = new Test(...args)

const group = new Group(...args)

/**
 * The follow tap method will not be called for this
 * test
 */
group.add(test)

group.tap((t) => {
})

/**
 * The above tap method will be called for the following
 */
group.add(test)

After this change, the tap method will run for all the tests registered with a group, regardless of when they are added. Same applies for other hooks as well

Commits

  • chore: configure c8 2a83807
  • chore: update dependencies d89d6d6
  • feat: improvements to onGroup, onTest, tap, and onSuite hooks 7791d2a

Full Changelog: v8.0.2...v8.1.0