From e89d4731bbaa5eae1f8629940609c96613ddbeef Mon Sep 17 00:00:00 2001 From: richiemccoll Date: Fri, 10 Feb 2023 11:04:03 +0200 Subject: [PATCH] test_runner: describe it only shorthand --- doc/api/test.md | 10 ++++ lib/internal/test_runner/harness.js | 2 +- test/message/test_runner_only_tests.js | 34 +++++++++++- test/message/test_runner_only_tests.out | 70 +++++++++++++++++++++++-- 4 files changed, 110 insertions(+), 6 deletions(-) diff --git a/doc/api/test.md b/doc/api/test.md index be5b9baeeb9fbe..15748ad0edabe8 100644 --- a/doc/api/test.md +++ b/doc/api/test.md @@ -808,6 +808,11 @@ Shorthand for skipping a suite, same as [`describe([name], { skip: true }[, fn]) Shorthand for marking a suite as `TODO`, same as [`describe([name], { todo: true }[, fn])`][describe options]. +## `describe.only([name][, options][, fn])` + +Shorthand for marking a suite as `only`, same as +[`describe([name], { only: true }[, fn])`][describe options]. + ## `it([name][, options][, fn])` * `name` {string} The name of the test, which is displayed when reporting test @@ -832,6 +837,11 @@ same as [`it([name], { skip: true }[, fn])`][it options]. Shorthand for marking a test as `TODO`, same as [`it([name], { todo: true }[, fn])`][it options]. +## `it.only([name][, options][, fn])` + +Shorthand for marking a test as `only`, +same as [`it([name], { only: true }[, fn])`][it options]. + ## `before([fn][, options])`