Tell a skip you meant from one you didn't

Mark an environmental skip as unexpected with skipUnexpectedly, and the Test Run page shows it apart from the tests you chose to skip.

Playwright records every skip the same way. A test you turned off on purpose and a test whose setup gave up on a broken environment look identical, so a bad night can look like a quiet one.

Call skipUnexpectedly(testInfo, reason) where your suite skips because something went wrong. The Test Run page now shows Unexpectedly Skipped apart from Skipped.

import { skipUnexpectedly } from '@donobu/test';

test.beforeEach(async ({}, testInfo) => {
  if (!(await resetSharedDocument())) {
    skipUnexpectedly(testInfo, 'Document reset timed out');
  }
});
  • Available in @donobu/test 1.49.0
  • Works in a hook or in the test body
  • Unexpected skips are shown in full color; declared skips are muted