npm @storybook/test-runner 0.20.0-next.2
v0.20.0-next.2

latest releases: 0.23.1--canary.d0c3175.0, 0.23.1--canary.29f1ef4.0, 0.23.1--canary.dbc63e2.0...
9 months ago

Release Notes

Feature: Run postVisit on failures (#494)

The test-runner's postVisit hook now runs even if there are failures. This allows you to, for instance, take snapshots on component failures. You can check whether the test has failed via the hasFailure property in the context passed to the hook:

const config: TestRunnerConfig = {
  async postVisit(_page, context) {
    if(context.hasFailure) {
      console.log('problems!')
      // do a snapshot, write a log, or anything you like
    }
  },
}

🚀 Enhancement

Authors: 1

Don't miss a new test-runner release

NewReleases is sending notifications on new releases.