xref: /third_party/node/doc/api/test.json (revision 1cb0ef41)
11cb0ef41Sopenharmony_ci{
21cb0ef41Sopenharmony_ci  "type": "module",
31cb0ef41Sopenharmony_ci  "source": "doc/api/test.md",
41cb0ef41Sopenharmony_ci  "modules": [
51cb0ef41Sopenharmony_ci    {
61cb0ef41Sopenharmony_ci      "textRaw": "Test runner",
71cb0ef41Sopenharmony_ci      "name": "test_runner",
81cb0ef41Sopenharmony_ci      "introduced_in": "v18.0.0",
91cb0ef41Sopenharmony_ci      "meta": {
101cb0ef41Sopenharmony_ci        "added": [
111cb0ef41Sopenharmony_ci          "v18.0.0",
121cb0ef41Sopenharmony_ci          "v16.17.0"
131cb0ef41Sopenharmony_ci        ],
141cb0ef41Sopenharmony_ci        "changes": []
151cb0ef41Sopenharmony_ci      },
161cb0ef41Sopenharmony_ci      "stability": 1,
171cb0ef41Sopenharmony_ci      "stabilityText": "Experimental",
181cb0ef41Sopenharmony_ci      "desc": "<p><strong>Source Code:</strong> <a href=\"https://github.com/nodejs/node/blob/v18.20.1/lib/test.js\">lib/test.js</a></p>\n<p>The <code>node:test</code> module facilitates the creation of JavaScript tests.\nTo access it:</p>\n<pre><code class=\"language-mjs\">import test from 'node:test';\n</code></pre>\n<pre><code class=\"language-cjs\">const test = require('node:test');\n</code></pre>\n<p>This module is only available under the <code>node:</code> scheme. The following will not\nwork:</p>\n<pre><code class=\"language-mjs\">import test from 'test';\n</code></pre>\n<pre><code class=\"language-cjs\">const test = require('test');\n</code></pre>\n<p>Tests created via the <code>test</code> module consist of a single function that is\nprocessed in one of three ways:</p>\n<ol>\n<li>A synchronous function that is considered failing if it throws an exception,\nand is considered passing otherwise.</li>\n<li>A function that returns a <code>Promise</code> that is considered failing if the\n<code>Promise</code> rejects, and is considered passing if the <code>Promise</code> resolves.</li>\n<li>A function that receives a callback function. If the callback receives any\ntruthy value as its first argument, the test is considered failing. If a\nfalsy value is passed as the first argument to the callback, the test is\nconsidered passing. If the test function receives a callback function and\nalso returns a <code>Promise</code>, the test will fail.</li>\n</ol>\n<p>The following example illustrates how tests are written using the\n<code>test</code> module.</p>\n<pre><code class=\"language-js\">test('synchronous passing test', (t) => {\n  // This test passes because it does not throw an exception.\n  assert.strictEqual(1, 1);\n});\n\ntest('synchronous failing test', (t) => {\n  // This test fails because it throws an exception.\n  assert.strictEqual(1, 2);\n});\n\ntest('asynchronous passing test', async (t) => {\n  // This test passes because the Promise returned by the async\n  // function is not rejected.\n  assert.strictEqual(1, 1);\n});\n\ntest('asynchronous failing test', async (t) => {\n  // This test fails because the Promise returned by the async\n  // function is rejected.\n  assert.strictEqual(1, 2);\n});\n\ntest('failing test using Promises', (t) => {\n  // Promises can be used directly as well.\n  return new Promise((resolve, reject) => {\n    setImmediate(() => {\n      reject(new Error('this will cause the test to fail'));\n    });\n  });\n});\n\ntest('callback passing test', (t, done) => {\n  // done() is the callback function. When the setImmediate() runs, it invokes\n  // done() with no arguments.\n  setImmediate(done);\n});\n\ntest('callback failing test', (t, done) => {\n  // When the setImmediate() runs, done() is invoked with an Error object and\n  // the test fails.\n  setImmediate(() => {\n    done(new Error('callback failure'));\n  });\n});\n</code></pre>\n<p>If any tests fail, the process exit code is set to <code>1</code>.</p>",
191cb0ef41Sopenharmony_ci      "modules": [
201cb0ef41Sopenharmony_ci        {
211cb0ef41Sopenharmony_ci          "textRaw": "Subtests",
221cb0ef41Sopenharmony_ci          "name": "subtests",
231cb0ef41Sopenharmony_ci          "desc": "<p>The test context's <code>test()</code> method allows subtests to be created. This method\nbehaves identically to the top level <code>test()</code> function. The following example\ndemonstrates the creation of a top level test with two subtests.</p>\n<pre><code class=\"language-js\">test('top level test', async (t) => {\n  await t.test('subtest 1', (t) => {\n    assert.strictEqual(1, 1);\n  });\n\n  await t.test('subtest 2', (t) => {\n    assert.strictEqual(2, 2);\n  });\n});\n</code></pre>\n<p>In this example, <code>await</code> is used to ensure that both subtests have completed.\nThis is necessary because parent tests do not wait for their subtests to\ncomplete. Any subtests that are still outstanding when their parent finishes\nare cancelled and treated as failures. Any subtest failures cause the parent\ntest to fail.</p>",
241cb0ef41Sopenharmony_ci          "type": "module",
251cb0ef41Sopenharmony_ci          "displayName": "Subtests"
261cb0ef41Sopenharmony_ci        },
271cb0ef41Sopenharmony_ci        {
281cb0ef41Sopenharmony_ci          "textRaw": "Skipping tests",
291cb0ef41Sopenharmony_ci          "name": "skipping_tests",
301cb0ef41Sopenharmony_ci          "desc": "<p>Individual tests can be skipped by passing the <code>skip</code> option to the test, or by\ncalling the test context's <code>skip()</code> method as shown in the\nfollowing example.</p>\n<pre><code class=\"language-js\">// The skip option is used, but no message is provided.\ntest('skip option', { skip: true }, (t) => {\n  // This code is never executed.\n});\n\n// The skip option is used, and a message is provided.\ntest('skip option with message', { skip: 'this is skipped' }, (t) => {\n  // This code is never executed.\n});\n\ntest('skip() method', (t) => {\n  // Make sure to return here as well if the test contains additional logic.\n  t.skip();\n});\n\ntest('skip() method with message', (t) => {\n  // Make sure to return here as well if the test contains additional logic.\n  t.skip('this is skipped');\n});\n</code></pre>",
311cb0ef41Sopenharmony_ci          "type": "module",
321cb0ef41Sopenharmony_ci          "displayName": "Skipping tests"
331cb0ef41Sopenharmony_ci        },
341cb0ef41Sopenharmony_ci        {
351cb0ef41Sopenharmony_ci          "textRaw": "`describe`/`it` syntax",
361cb0ef41Sopenharmony_ci          "name": "`describe`/`it`_syntax",
371cb0ef41Sopenharmony_ci          "desc": "<p>Running tests can also be done using <code>describe</code> to declare a suite\nand <code>it</code> to declare a test.\nA suite is used to organize and group related tests together.\n<code>it</code> is a shorthand for <a href=\"#testname-options-fn\"><code>test()</code></a>.</p>\n<pre><code class=\"language-js\">describe('A thing', () => {\n  it('should work', () => {\n    assert.strictEqual(1, 1);\n  });\n\n  it('should be ok', () => {\n    assert.strictEqual(2, 2);\n  });\n\n  describe('a nested thing', () => {\n    it('should work', () => {\n      assert.strictEqual(3, 3);\n    });\n  });\n});\n</code></pre>\n<p><code>describe</code> and <code>it</code> are imported from the <code>node:test</code> module.</p>\n<pre><code class=\"language-mjs\">import { describe, it } from 'node:test';\n</code></pre>\n<pre><code class=\"language-cjs\">const { describe, it } = require('node:test');\n</code></pre>",
381cb0ef41Sopenharmony_ci          "type": "module",
391cb0ef41Sopenharmony_ci          "displayName": "`describe`/`it` syntax"
401cb0ef41Sopenharmony_ci        },
411cb0ef41Sopenharmony_ci        {
421cb0ef41Sopenharmony_ci          "textRaw": "`only` tests",
431cb0ef41Sopenharmony_ci          "name": "`only`_tests",
441cb0ef41Sopenharmony_ci          "desc": "<p>If Node.js is started with the <a href=\"cli.html#--test-only\"><code>--test-only</code></a> command-line option, it is\npossible to skip all top level tests except for a selected subset by passing\nthe <code>only</code> option to the tests that should be run. When a test with the <code>only</code>\noption set is run, all subtests are also run. The test context's <code>runOnly()</code>\nmethod can be used to implement the same behavior at the subtest level.</p>\n<pre><code class=\"language-js\">// Assume Node.js is run with the --test-only command-line option.\n// The 'only' option is set, so this test is run.\ntest('this test is run', { only: true }, async (t) => {\n  // Within this test, all subtests are run by default.\n  await t.test('running subtest');\n\n  // The test context can be updated to run subtests with the 'only' option.\n  t.runOnly(true);\n  await t.test('this subtest is now skipped');\n  await t.test('this subtest is run', { only: true });\n\n  // Switch the context back to execute all tests.\n  t.runOnly(false);\n  await t.test('this subtest is now run');\n\n  // Explicitly do not run these tests.\n  await t.test('skipped subtest 3', { only: false });\n  await t.test('skipped subtest 4', { skip: true });\n});\n\n// The 'only' option is not set, so this test is skipped.\ntest('this test is not run', () => {\n  // This code is not run.\n  throw new Error('fail');\n});\n</code></pre>",
451cb0ef41Sopenharmony_ci          "type": "module",
461cb0ef41Sopenharmony_ci          "displayName": "`only` tests"
471cb0ef41Sopenharmony_ci        },
481cb0ef41Sopenharmony_ci        {
491cb0ef41Sopenharmony_ci          "textRaw": "Filtering tests by name",
501cb0ef41Sopenharmony_ci          "name": "filtering_tests_by_name",
511cb0ef41Sopenharmony_ci          "desc": "<p>The <a href=\"cli.html#--test-name-pattern\"><code>--test-name-pattern</code></a> command-line option can be used to only run tests\nwhose name matches the provided pattern. Test name patterns are interpreted as\nJavaScript regular expressions. The <code>--test-name-pattern</code> option can be\nspecified multiple times in order to run nested tests. For each test that is\nexecuted, any corresponding test hooks, such as <code>beforeEach()</code>, are also\nrun.</p>\n<p>Given the following test file, starting Node.js with the\n<code>--test-name-pattern=\"test [1-3]\"</code> option would cause the test runner to execute\n<code>test 1</code>, <code>test 2</code>, and <code>test 3</code>. If <code>test 1</code> did not match the test name\npattern, then its subtests would not execute, despite matching the pattern. The\nsame set of tests could also be executed by passing <code>--test-name-pattern</code>\nmultiple times (e.g. <code>--test-name-pattern=\"test 1\"</code>,\n<code>--test-name-pattern=\"test 2\"</code>, etc.).</p>\n<pre><code class=\"language-js\">test('test 1', async (t) => {\n  await t.test('test 2');\n  await t.test('test 3');\n});\n\ntest('Test 4', async (t) => {\n  await t.test('Test 5');\n  await t.test('test 6');\n});\n</code></pre>\n<p>Test name patterns can also be specified using regular expression literals. This\nallows regular expression flags to be used. In the previous example, starting\nNode.js with <code>--test-name-pattern=\"/test [4-5]/i\"</code> would match <code>Test 4</code> and\n<code>Test 5</code> because the pattern is case-insensitive.</p>\n<p>Test name patterns do not change the set of files that the test runner executes.</p>",
521cb0ef41Sopenharmony_ci          "type": "module",
531cb0ef41Sopenharmony_ci          "displayName": "Filtering tests by name"
541cb0ef41Sopenharmony_ci        },
551cb0ef41Sopenharmony_ci        {
561cb0ef41Sopenharmony_ci          "textRaw": "Extraneous asynchronous activity",
571cb0ef41Sopenharmony_ci          "name": "extraneous_asynchronous_activity",
581cb0ef41Sopenharmony_ci          "desc": "<p>Once a test function finishes executing, the results are reported as quickly\nas possible while maintaining the order of the tests. However, it is possible\nfor the test function to generate asynchronous activity that outlives the test\nitself. The test runner handles this type of activity, but does not delay the\nreporting of test results in order to accommodate it.</p>\n<p>In the following example, a test completes with two <code>setImmediate()</code>\noperations still outstanding. The first <code>setImmediate()</code> attempts to create a\nnew subtest. Because the parent test has already finished and output its\nresults, the new subtest is immediately marked as failed, and reported later\nto the <a href=\"test.html#class-testsstream\" class=\"type\">&lt;TestsStream&gt;</a>.</p>\n<p>The second <code>setImmediate()</code> creates an <code>uncaughtException</code> event.\n<code>uncaughtException</code> and <code>unhandledRejection</code> events originating from a completed\ntest are marked as failed by the <code>test</code> module and reported as diagnostic\nwarnings at the top level by the <a href=\"test.html#class-testsstream\" class=\"type\">&lt;TestsStream&gt;</a>.</p>\n<pre><code class=\"language-js\">test('a test that creates asynchronous activity', (t) => {\n  setImmediate(() => {\n    t.test('subtest that is created too late', (t) => {\n      throw new Error('error1');\n    });\n  });\n\n  setImmediate(() => {\n    throw new Error('error2');\n  });\n\n  // The test finishes after this line.\n});\n</code></pre>",
591cb0ef41Sopenharmony_ci          "type": "module",
601cb0ef41Sopenharmony_ci          "displayName": "Extraneous asynchronous activity"
611cb0ef41Sopenharmony_ci        },
621cb0ef41Sopenharmony_ci        {
631cb0ef41Sopenharmony_ci          "textRaw": "Watch mode",
641cb0ef41Sopenharmony_ci          "name": "watch_mode",
651cb0ef41Sopenharmony_ci          "meta": {
661cb0ef41Sopenharmony_ci            "added": [
671cb0ef41Sopenharmony_ci              "v18.13.0"
681cb0ef41Sopenharmony_ci            ],
691cb0ef41Sopenharmony_ci            "changes": []
701cb0ef41Sopenharmony_ci          },
711cb0ef41Sopenharmony_ci          "stability": 1,
721cb0ef41Sopenharmony_ci          "stabilityText": "Experimental",
731cb0ef41Sopenharmony_ci          "desc": "<p>The Node.js test runner supports running in watch mode by passing the <code>--watch</code> flag:</p>\n<pre><code class=\"language-bash\">node --test --watch\n</code></pre>\n<p>In watch mode, the test runner will watch for changes to test files and\ntheir dependencies. When a change is detected, the test runner will\nrerun the tests affected by the change.\nThe test runner will continue to run until the process is terminated.</p>",
741cb0ef41Sopenharmony_ci          "type": "module",
751cb0ef41Sopenharmony_ci          "displayName": "Watch mode"
761cb0ef41Sopenharmony_ci        },
771cb0ef41Sopenharmony_ci        {
781cb0ef41Sopenharmony_ci          "textRaw": "Running tests from the command line",
791cb0ef41Sopenharmony_ci          "name": "running_tests_from_the_command_line",
801cb0ef41Sopenharmony_ci          "desc": "<p>The Node.js test runner can be invoked from the command line by passing the\n<a href=\"cli.html#--test\"><code>--test</code></a> flag:</p>\n<pre><code class=\"language-bash\">node --test\n</code></pre>\n<p>By default, Node.js will recursively search the current directory for\nJavaScript source files matching a specific naming convention. Matching files\nare executed as test files. More information on the expected test file naming\nconvention and behavior can be found in the <a href=\"#test-runner-execution-model\">test runner execution model</a>\nsection.</p>\n<p>Alternatively, one or more paths can be provided as the final argument(s) to\nthe Node.js command, as shown below.</p>\n<pre><code class=\"language-bash\">node --test test1.js test2.mjs custom_test_dir/\n</code></pre>\n<p>In this example, the test runner will execute the files <code>test1.js</code> and\n<code>test2.mjs</code>. The test runner will also recursively search the\n<code>custom_test_dir/</code> directory for test files to execute.</p>",
811cb0ef41Sopenharmony_ci          "modules": [
821cb0ef41Sopenharmony_ci            {
831cb0ef41Sopenharmony_ci              "textRaw": "Test runner execution model",
841cb0ef41Sopenharmony_ci              "name": "test_runner_execution_model",
851cb0ef41Sopenharmony_ci              "desc": "<p>When searching for test files to execute, the test runner behaves as follows:</p>\n<ul>\n<li>Any files explicitly provided by the user are executed.</li>\n<li>If the user did not explicitly specify any paths, the current working\ndirectory is recursively searched for files as specified in the following\nsteps.</li>\n<li><code>node_modules</code> directories are skipped unless explicitly provided by the\nuser.</li>\n<li>If a directory named <code>test</code> is encountered, the test runner will search it\nrecursively for all all <code>.js</code>, <code>.cjs</code>, and <code>.mjs</code> files. All of these files\nare treated as test files, and do not need to match the specific naming\nconvention detailed below. This is to accommodate projects that place all of\ntheir tests in a single <code>test</code> directory.</li>\n<li>In all other directories, <code>.js</code>, <code>.cjs</code>, and <code>.mjs</code> files matching the\nfollowing patterns are treated as test files:\n<ul>\n<li><code>^test$</code> - Files whose basename is the string <code>'test'</code>. Examples:\n<code>test.js</code>, <code>test.cjs</code>, <code>test.mjs</code>.</li>\n<li><code>^test-.+</code> - Files whose basename starts with the string <code>'test-'</code>\nfollowed by one or more characters. Examples: <code>test-example.js</code>,\n<code>test-another-example.mjs</code>.</li>\n<li><code>.+[\\.\\-\\_]test$</code> - Files whose basename ends with <code>.test</code>, <code>-test</code>, or\n<code>_test</code>, preceded by one or more characters. Examples: <code>example.test.js</code>,\n<code>example-test.cjs</code>, <code>example_test.mjs</code>.</li>\n<li>Other file types understood by Node.js such as <code>.node</code> and <code>.json</code> are not\nautomatically executed by the test runner, but are supported if explicitly\nprovided on the command line.</li>\n</ul>\n</li>\n</ul>\n<p>Each matching test file is executed in a separate child process. The maximum\nnumber of child processes running at any time is controlled by the\n<a href=\"cli.html#--test-concurrency\"><code>--test-concurrency</code></a> flag. If the child process finishes with an exit code\nof 0, the test is considered passing. Otherwise, the test is considered to be a\nfailure. Test files must be executable by Node.js, but are not required to use\nthe <code>node:test</code> module internally.</p>\n<p>Each test file is executed as if it was a regular script. That is, if the test\nfile itself uses <code>node:test</code> to define tests, all of those tests will be\nexecuted within a single application thread, regardless of the value of the\n<code>concurrency</code> option of <a href=\"#testname-options-fn\"><code>test()</code></a>.</p>",
861cb0ef41Sopenharmony_ci              "type": "module",
871cb0ef41Sopenharmony_ci              "displayName": "Test runner execution model"
881cb0ef41Sopenharmony_ci            }
891cb0ef41Sopenharmony_ci          ],
901cb0ef41Sopenharmony_ci          "type": "module",
911cb0ef41Sopenharmony_ci          "displayName": "Running tests from the command line"
921cb0ef41Sopenharmony_ci        },
931cb0ef41Sopenharmony_ci        {
941cb0ef41Sopenharmony_ci          "textRaw": "Collecting code coverage",
951cb0ef41Sopenharmony_ci          "name": "collecting_code_coverage",
961cb0ef41Sopenharmony_ci          "desc": "<p>When Node.js is started with the <a href=\"cli.html#--experimental-test-coverage\"><code>--experimental-test-coverage</code></a>\ncommand-line flag, code coverage is collected and statistics are reported once\nall tests have completed. If the <a href=\"cli.html#node_v8_coveragedir\"><code>NODE_V8_COVERAGE</code></a> environment variable is\nused to specify a code coverage directory, the generated V8 coverage files are\nwritten to that directory. Node.js core modules and files within\n<code>node_modules/</code> directories are not included in the coverage report. If\ncoverage is enabled, the coverage report is sent to any <a href=\"#test-reporters\">test reporters</a> via\nthe <code>'test:coverage'</code> event.</p>\n<p>Coverage can be disabled on a series of lines using the following\ncomment syntax:</p>\n<pre><code class=\"language-js\">/* node:coverage disable */\nif (anAlwaysFalseCondition) {\n  // Code in this branch will never be executed, but the lines are ignored for\n  // coverage purposes. All lines following the 'disable' comment are ignored\n  // until a corresponding 'enable' comment is encountered.\n  console.log('this is never executed');\n}\n/* node:coverage enable */\n</code></pre>\n<p>Coverage can also be disabled for a specified number of lines. After the\nspecified number of lines, coverage will be automatically reenabled. If the\nnumber of lines is not explicitly provided, a single line is ignored.</p>\n<pre><code class=\"language-js\">/* node:coverage ignore next */\nif (anAlwaysFalseCondition) { console.log('this is never executed'); }\n\n/* node:coverage ignore next 3 */\nif (anAlwaysFalseCondition) {\n  console.log('this is never executed');\n}\n</code></pre>\n<p>The test runner's code coverage functionality has the following limitations,\nwhich will be addressed in a future Node.js release:</p>\n<ul>\n<li>Source maps are not supported.</li>\n<li>Excluding specific files or directories from the coverage report is not\nsupported.</li>\n</ul>",
971cb0ef41Sopenharmony_ci          "type": "module",
981cb0ef41Sopenharmony_ci          "displayName": "Collecting code coverage"
991cb0ef41Sopenharmony_ci        },
1001cb0ef41Sopenharmony_ci        {
1011cb0ef41Sopenharmony_ci          "textRaw": "Mocking",
1021cb0ef41Sopenharmony_ci          "name": "mocking",
1031cb0ef41Sopenharmony_ci          "desc": "<p>The <code>node:test</code> module supports mocking during testing via a top-level <code>mock</code>\nobject. The following example creates a spy on a function that adds two numbers\ntogether. The spy is then used to assert that the function was called as\nexpected.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { mock, test } from 'node:test';\n\ntest('spies on a function', () => {\n  const sum = mock.fn((a, b) => {\n    return a + b;\n  });\n\n  assert.strictEqual(sum.mock.calls.length, 0);\n  assert.strictEqual(sum(3, 4), 7);\n  assert.strictEqual(sum.mock.calls.length, 1);\n\n  const call = sum.mock.calls[0];\n  assert.deepStrictEqual(call.arguments, [3, 4]);\n  assert.strictEqual(call.result, 7);\n  assert.strictEqual(call.error, undefined);\n\n  // Reset the globally tracked mocks.\n  mock.reset();\n});\n</code></pre>\n<pre><code class=\"language-cjs\">'use strict';\nconst assert = require('node:assert');\nconst { mock, test } = require('node:test');\n\ntest('spies on a function', () => {\n  const sum = mock.fn((a, b) => {\n    return a + b;\n  });\n\n  assert.strictEqual(sum.mock.calls.length, 0);\n  assert.strictEqual(sum(3, 4), 7);\n  assert.strictEqual(sum.mock.calls.length, 1);\n\n  const call = sum.mock.calls[0];\n  assert.deepStrictEqual(call.arguments, [3, 4]);\n  assert.strictEqual(call.result, 7);\n  assert.strictEqual(call.error, undefined);\n\n  // Reset the globally tracked mocks.\n  mock.reset();\n});\n</code></pre>\n<p>The same mocking functionality is also exposed on the <a href=\"#class-testcontext\"><code>TestContext</code></a> object\nof each test. The following example creates a spy on an object method using the\nAPI exposed on the <code>TestContext</code>. The benefit of mocking via the test context is\nthat the test runner will automatically restore all mocked functionality once\nthe test finishes.</p>\n<pre><code class=\"language-js\">test('spies on an object method', (t) => {\n  const number = {\n    value: 5,\n    add(a) {\n      return this.value + a;\n    },\n  };\n\n  t.mock.method(number, 'add');\n  assert.strictEqual(number.add.mock.calls.length, 0);\n  assert.strictEqual(number.add(3), 8);\n  assert.strictEqual(number.add.mock.calls.length, 1);\n\n  const call = number.add.mock.calls[0];\n\n  assert.deepStrictEqual(call.arguments, [3]);\n  assert.strictEqual(call.result, 8);\n  assert.strictEqual(call.target, undefined);\n  assert.strictEqual(call.this, number);\n});\n</code></pre>",
1041cb0ef41Sopenharmony_ci          "modules": [
1051cb0ef41Sopenharmony_ci            {
1061cb0ef41Sopenharmony_ci              "textRaw": "Timers",
1071cb0ef41Sopenharmony_ci              "name": "timers",
1081cb0ef41Sopenharmony_ci              "desc": "<p>Mocking timers is a technique commonly used in software testing to simulate and\ncontrol the behavior of timers, such as <code>setInterval</code> and <code>setTimeout</code>,\nwithout actually waiting for the specified time intervals.</p>\n<p>Refer to the <a href=\"#class-mocktimers\"><code>MockTimers</code></a> class for a full list of methods and features.</p>\n<p>This allows developers to write more reliable and\npredictable tests for time-dependent functionality.</p>\n<p>The example below shows how to mock <code>setTimeout</code>.\nUsing <code>.enable(['setTimeout']);</code>\nit will mock the <code>setTimeout</code> functions in the <a href=\"./timers.html\">node:timers</a> and\n<a href=\"./timers.html#timers-promises-api\">node:timers/promises</a> modules,\nas well as from the Node.js global context.</p>\n<p><strong>Note:</strong> Destructuring functions such as\n<code>import { setTimeout } from 'node:timers'</code>\nis currently not supported by this API.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { mock, test } from 'node:test';\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', () => {\n  const fn = mock.fn();\n\n  // Optionally choose what to mock\n  mock.timers.enable(['setTimeout']);\n  setTimeout(fn, 9999);\n  assert.strictEqual(fn.mock.callCount(), 0);\n\n  // Advance in time\n  mock.timers.tick(9999);\n  assert.strictEqual(fn.mock.callCount(), 1);\n\n  // Reset the globally tracked mocks.\n  mock.timers.reset();\n\n  // If you call reset mock instance, it will also reset timers instance\n  mock.reset();\n});\n</code></pre>\n<pre><code class=\"language-js\">const assert = require('node:assert');\nconst { mock, test } = require('node:test');\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', () => {\n  const fn = mock.fn();\n\n  // Optionally choose what to mock\n  mock.timers.enable(['setTimeout']);\n  setTimeout(fn, 9999);\n  assert.strictEqual(fn.mock.callCount(), 0);\n\n  // Advance in time\n  mock.timers.tick(9999);\n  assert.strictEqual(fn.mock.callCount(), 1);\n\n  // Reset the globally tracked mocks.\n  mock.timers.reset();\n\n  // If you call reset mock instance, it'll also reset timers instance\n  mock.reset();\n});\n</code></pre>\n<p>The same mocking functionality is also exposed in the mock property on the <a href=\"#class-testcontext\"><code>TestContext</code></a> object\nof each test. The benefit of mocking via the test context is\nthat the test runner will automatically restore all mocked timers\nfunctionality once the test finishes.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n\n  // Optionally choose what to mock\n  context.mock.timers.enable(['setTimeout']);\n  setTimeout(fn, 9999);\n  assert.strictEqual(fn.mock.callCount(), 0);\n\n  // Advance in time\n  context.mock.timers.tick(9999);\n  assert.strictEqual(fn.mock.callCount(), 1);\n});\n</code></pre>\n<pre><code class=\"language-js\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n\n  // Optionally choose what to mock\n  context.mock.timers.enable(['setTimeout']);\n  setTimeout(fn, 9999);\n  assert.strictEqual(fn.mock.callCount(), 0);\n\n  // Advance in time\n  context.mock.timers.tick(9999);\n  assert.strictEqual(fn.mock.callCount(), 1);\n});\n</code></pre>",
1091cb0ef41Sopenharmony_ci              "type": "module",
1101cb0ef41Sopenharmony_ci              "displayName": "Timers"
1111cb0ef41Sopenharmony_ci            }
1121cb0ef41Sopenharmony_ci          ],
1131cb0ef41Sopenharmony_ci          "type": "module",
1141cb0ef41Sopenharmony_ci          "displayName": "Mocking"
1151cb0ef41Sopenharmony_ci        },
1161cb0ef41Sopenharmony_ci        {
1171cb0ef41Sopenharmony_ci          "textRaw": "Test reporters",
1181cb0ef41Sopenharmony_ci          "name": "test_reporters",
1191cb0ef41Sopenharmony_ci          "meta": {
1201cb0ef41Sopenharmony_ci            "added": [
1211cb0ef41Sopenharmony_ci              "v18.15.0"
1221cb0ef41Sopenharmony_ci            ],
1231cb0ef41Sopenharmony_ci            "changes": [
1241cb0ef41Sopenharmony_ci              {
1251cb0ef41Sopenharmony_ci                "version": "v18.17.0",
1261cb0ef41Sopenharmony_ci                "pr-url": "https://github.com/nodejs/node/pull/47238",
1271cb0ef41Sopenharmony_ci                "description": "Reporters are now exposed at `node:test/reporters`."
1281cb0ef41Sopenharmony_ci              }
1291cb0ef41Sopenharmony_ci            ]
1301cb0ef41Sopenharmony_ci          },
1311cb0ef41Sopenharmony_ci          "desc": "<p>The <code>node:test</code> module supports passing <a href=\"cli.html#--test-reporter\"><code>--test-reporter</code></a>\nflags for the test runner to use a specific reporter.</p>\n<p>The following built-reporters are supported:</p>\n<ul>\n<li>\n<p><code>tap</code>\nThe <code>tap</code> reporter outputs the test results in the <a href=\"https://testanything.org/\">TAP</a> format.</p>\n</li>\n<li>\n<p><code>spec</code>\nThe <code>spec</code> reporter outputs the test results in a human-readable format.</p>\n</li>\n<li>\n<p><code>dot</code>\nThe <code>dot</code> reporter outputs the test results in a compact format,\nwhere each passing test is represented by a <code>.</code>,\nand each failing test is represented by a <code>X</code>.</p>\n</li>\n<li>\n<p><code>junit</code>\nThe junit reporter outputs test results in a jUnit XML format</p>\n</li>\n</ul>\n<p>When <code>stdout</code> is a <a href=\"tty.html\">TTY</a>, the <code>spec</code> reporter is used by default.\nOtherwise, the <code>tap</code> reporter is used by default.</p>\n<p>The reporters are available via the <code>node:test/reporters</code> module:</p>\n<pre><code class=\"language-mjs\">import { tap, spec, dot, junit } from 'node:test/reporters';\n</code></pre>\n<pre><code class=\"language-cjs\">const { tap, spec, dot, junit } = require('node:test/reporters');\n</code></pre>",
1321cb0ef41Sopenharmony_ci          "modules": [
1331cb0ef41Sopenharmony_ci            {
1341cb0ef41Sopenharmony_ci              "textRaw": "Custom reporters",
1351cb0ef41Sopenharmony_ci              "name": "custom_reporters",
1361cb0ef41Sopenharmony_ci              "desc": "<p><a href=\"cli.html#--test-reporter\"><code>--test-reporter</code></a> can be used to specify a path to custom reporter.\nA custom reporter is a module that exports a value\naccepted by <a href=\"stream.html#streamcomposestreams\">stream.compose</a>.\nReporters should transform events emitted by a <a href=\"test.html#class-testsstream\" class=\"type\">&lt;TestsStream&gt;</a></p>\n<p>Example of a custom reporter using <a href=\"stream.html#class-streamtransform\" class=\"type\">&lt;stream.Transform&gt;</a>:</p>\n<pre><code class=\"language-mjs\">import { Transform } from 'node:stream';\n\nconst customReporter = new Transform({\n  writableObjectMode: true,\n  transform(event, encoding, callback) {\n    switch (event.type) {\n      case 'test:dequeue':\n        callback(null, `test ${event.data.name} dequeued`);\n        break;\n      case 'test:enqueue':\n        callback(null, `test ${event.data.name} enqueued`);\n        break;\n      case 'test:watch:drained':\n        callback(null, 'test watch queue drained');\n        break;\n      case 'test:start':\n        callback(null, `test ${event.data.name} started`);\n        break;\n      case 'test:pass':\n        callback(null, `test ${event.data.name} passed`);\n        break;\n      case 'test:fail':\n        callback(null, `test ${event.data.name} failed`);\n        break;\n      case 'test:plan':\n        callback(null, 'test plan');\n        break;\n      case 'test:diagnostic':\n      case 'test:stderr':\n      case 'test:stdout':\n        callback(null, event.data.message);\n        break;\n      case 'test:coverage': {\n        const { totalLineCount } = event.data.summary.totals;\n        callback(null, `total line count: ${totalLineCount}\\n`);\n        break;\n      }\n    }\n  },\n});\n\nexport default customReporter;\n</code></pre>\n<pre><code class=\"language-cjs\">const { Transform } = require('node:stream');\n\nconst customReporter = new Transform({\n  writableObjectMode: true,\n  transform(event, encoding, callback) {\n    switch (event.type) {\n      case 'test:dequeue':\n        callback(null, `test ${event.data.name} dequeued`);\n        break;\n      case 'test:enqueue':\n        callback(null, `test ${event.data.name} enqueued`);\n        break;\n      case 'test:watch:drained':\n        callback(null, 'test watch queue drained');\n        break;\n      case 'test:start':\n        callback(null, `test ${event.data.name} started`);\n        break;\n      case 'test:pass':\n        callback(null, `test ${event.data.name} passed`);\n        break;\n      case 'test:fail':\n        callback(null, `test ${event.data.name} failed`);\n        break;\n      case 'test:plan':\n        callback(null, 'test plan');\n        break;\n      case 'test:diagnostic':\n      case 'test:stderr':\n      case 'test:stdout':\n        callback(null, event.data.message);\n        break;\n      case 'test:coverage': {\n        const { totalLineCount } = event.data.summary.totals;\n        callback(null, `total line count: ${totalLineCount}\\n`);\n        break;\n      }\n    }\n  },\n});\n\nmodule.exports = customReporter;\n</code></pre>\n<p>Example of a custom reporter using a generator function:</p>\n<pre><code class=\"language-mjs\">export default async function * customReporter(source) {\n  for await (const event of source) {\n    switch (event.type) {\n      case 'test:dequeue':\n        yield `test ${event.data.name} dequeued`;\n        break;\n      case 'test:enqueue':\n        yield `test ${event.data.name} enqueued`;\n        break;\n      case 'test:watch:drained':\n        yield 'test watch queue drained';\n        break;\n      case 'test:start':\n        yield `test ${event.data.name} started\\n`;\n        break;\n      case 'test:pass':\n        yield `test ${event.data.name} passed\\n`;\n        break;\n      case 'test:fail':\n        yield `test ${event.data.name} failed\\n`;\n        break;\n      case 'test:plan':\n        yield 'test plan';\n        break;\n      case 'test:diagnostic':\n      case 'test:stderr':\n      case 'test:stdout':\n        yield `${event.data.message}\\n`;\n        break;\n      case 'test:coverage': {\n        const { totalLineCount } = event.data.summary.totals;\n        yield `total line count: ${totalLineCount}\\n`;\n        break;\n      }\n    }\n  }\n}\n</code></pre>\n<pre><code class=\"language-cjs\">module.exports = async function * customReporter(source) {\n  for await (const event of source) {\n    switch (event.type) {\n      case 'test:dequeue':\n        yield `test ${event.data.name} dequeued`;\n        break;\n      case 'test:enqueue':\n        yield `test ${event.data.name} enqueued`;\n        break;\n      case 'test:watch:drained':\n        yield 'test watch queue drained';\n        break;\n      case 'test:start':\n        yield `test ${event.data.name} started\\n`;\n        break;\n      case 'test:pass':\n        yield `test ${event.data.name} passed\\n`;\n        break;\n      case 'test:fail':\n        yield `test ${event.data.name} failed\\n`;\n        break;\n      case 'test:plan':\n        yield 'test plan\\n';\n        break;\n      case 'test:diagnostic':\n      case 'test:stderr':\n      case 'test:stdout':\n        yield `${event.data.message}\\n`;\n        break;\n      case 'test:coverage': {\n        const { totalLineCount } = event.data.summary.totals;\n        yield `total line count: ${totalLineCount}\\n`;\n        break;\n      }\n    }\n  }\n};\n</code></pre>\n<p>The value provided to <code>--test-reporter</code> should be a string like one used in an\n<code>import()</code> in JavaScript code.</p>",
1371cb0ef41Sopenharmony_ci              "type": "module",
1381cb0ef41Sopenharmony_ci              "displayName": "Custom reporters"
1391cb0ef41Sopenharmony_ci            },
1401cb0ef41Sopenharmony_ci            {
1411cb0ef41Sopenharmony_ci              "textRaw": "Multiple reporters",
1421cb0ef41Sopenharmony_ci              "name": "multiple_reporters",
1431cb0ef41Sopenharmony_ci              "desc": "<p>The <a href=\"cli.html#--test-reporter\"><code>--test-reporter</code></a> flag can be specified multiple times to report test\nresults in several formats. In this situation\nit is required to specify a destination for each reporter\nusing <a href=\"cli.html#--test-reporter-destination\"><code>--test-reporter-destination</code></a>.\nDestination can be <code>stdout</code>, <code>stderr</code>, or a file path.\nReporters and destinations are paired according\nto the order they were specified.</p>\n<p>In the following example, the <code>spec</code> reporter will output to <code>stdout</code>,\nand the <code>dot</code> reporter will output to <code>file.txt</code>:</p>\n<pre><code class=\"language-bash\">node --test-reporter=spec --test-reporter=dot --test-reporter-destination=stdout --test-reporter-destination=file.txt\n</code></pre>\n<p>When a single reporter is specified, the destination will default to <code>stdout</code>,\nunless a destination is explicitly provided.</p>",
1441cb0ef41Sopenharmony_ci              "type": "module",
1451cb0ef41Sopenharmony_ci              "displayName": "Multiple reporters"
1461cb0ef41Sopenharmony_ci            }
1471cb0ef41Sopenharmony_ci          ],
1481cb0ef41Sopenharmony_ci          "type": "module",
1491cb0ef41Sopenharmony_ci          "displayName": "Test reporters"
1501cb0ef41Sopenharmony_ci        }
1511cb0ef41Sopenharmony_ci      ],
1521cb0ef41Sopenharmony_ci      "methods": [
1531cb0ef41Sopenharmony_ci        {
1541cb0ef41Sopenharmony_ci          "textRaw": "`run([options])`",
1551cb0ef41Sopenharmony_ci          "type": "method",
1561cb0ef41Sopenharmony_ci          "name": "run",
1571cb0ef41Sopenharmony_ci          "meta": {
1581cb0ef41Sopenharmony_ci            "added": [
1591cb0ef41Sopenharmony_ci              "v18.9.0"
1601cb0ef41Sopenharmony_ci            ],
1611cb0ef41Sopenharmony_ci            "changes": [
1621cb0ef41Sopenharmony_ci              {
1631cb0ef41Sopenharmony_ci                "version": "v18.17.0",
1641cb0ef41Sopenharmony_ci                "pr-url": "https://github.com/nodejs/node/pull/47628",
1651cb0ef41Sopenharmony_ci                "description": "Add a testNamePatterns option."
1661cb0ef41Sopenharmony_ci              }
1671cb0ef41Sopenharmony_ci            ]
1681cb0ef41Sopenharmony_ci          },
1691cb0ef41Sopenharmony_ci          "signatures": [
1701cb0ef41Sopenharmony_ci            {
1711cb0ef41Sopenharmony_ci              "return": {
1721cb0ef41Sopenharmony_ci                "textRaw": "Returns: {TestsStream}",
1731cb0ef41Sopenharmony_ci                "name": "return",
1741cb0ef41Sopenharmony_ci                "type": "TestsStream"
1751cb0ef41Sopenharmony_ci              },
1761cb0ef41Sopenharmony_ci              "params": [
1771cb0ef41Sopenharmony_ci                {
1781cb0ef41Sopenharmony_ci                  "textRaw": "`options` {Object} Configuration options for running tests. The following properties are supported:",
1791cb0ef41Sopenharmony_ci                  "name": "options",
1801cb0ef41Sopenharmony_ci                  "type": "Object",
1811cb0ef41Sopenharmony_ci                  "desc": "Configuration options for running tests. The following properties are supported:",
1821cb0ef41Sopenharmony_ci                  "options": [
1831cb0ef41Sopenharmony_ci                    {
1841cb0ef41Sopenharmony_ci                      "textRaw": "`concurrency` {number|boolean} If a number is provided, then that many test processes would run in parallel, where each process corresponds to one test file. If `true`, it would run `os.availableParallelism() - 1` test files in parallel. If `false`, it would only run one test file at a time. **Default:** `false`.",
1851cb0ef41Sopenharmony_ci                      "name": "concurrency",
1861cb0ef41Sopenharmony_ci                      "type": "number|boolean",
1871cb0ef41Sopenharmony_ci                      "default": "`false`",
1881cb0ef41Sopenharmony_ci                      "desc": "If a number is provided, then that many test processes would run in parallel, where each process corresponds to one test file. If `true`, it would run `os.availableParallelism() - 1` test files in parallel. If `false`, it would only run one test file at a time."
1891cb0ef41Sopenharmony_ci                    },
1901cb0ef41Sopenharmony_ci                    {
1911cb0ef41Sopenharmony_ci                      "textRaw": "`files`: {Array} An array containing the list of files to run. **Default** matching files from [test runner execution model][].",
1921cb0ef41Sopenharmony_ci                      "name": "files",
1931cb0ef41Sopenharmony_ci                      "type": "Array",
1941cb0ef41Sopenharmony_ci                      "desc": "An array containing the list of files to run. **Default** matching files from [test runner execution model][]."
1951cb0ef41Sopenharmony_ci                    },
1961cb0ef41Sopenharmony_ci                    {
1971cb0ef41Sopenharmony_ci                      "textRaw": "`inspectPort` {number|Function} Sets inspector port of test child process. This can be a number, or a function that takes no arguments and returns a number. If a nullish value is provided, each process gets its own port, incremented from the primary's `process.debugPort`. **Default:** `undefined`.",
1981cb0ef41Sopenharmony_ci                      "name": "inspectPort",
1991cb0ef41Sopenharmony_ci                      "type": "number|Function",
2001cb0ef41Sopenharmony_ci                      "default": "`undefined`",
2011cb0ef41Sopenharmony_ci                      "desc": "Sets inspector port of test child process. This can be a number, or a function that takes no arguments and returns a number. If a nullish value is provided, each process gets its own port, incremented from the primary's `process.debugPort`."
2021cb0ef41Sopenharmony_ci                    },
2031cb0ef41Sopenharmony_ci                    {
2041cb0ef41Sopenharmony_ci                      "textRaw": "`only`: {boolean} If truthy, the test context will only run tests that have the `only` option set",
2051cb0ef41Sopenharmony_ci                      "name": "only",
2061cb0ef41Sopenharmony_ci                      "type": "boolean",
2071cb0ef41Sopenharmony_ci                      "desc": "If truthy, the test context will only run tests that have the `only` option set"
2081cb0ef41Sopenharmony_ci                    },
2091cb0ef41Sopenharmony_ci                    {
2101cb0ef41Sopenharmony_ci                      "textRaw": "`setup` {Function} A function that accepts the `TestsStream` instance and can be used to setup listeners before any tests are run. **Default:** `undefined`.",
2111cb0ef41Sopenharmony_ci                      "name": "setup",
2121cb0ef41Sopenharmony_ci                      "type": "Function",
2131cb0ef41Sopenharmony_ci                      "default": "`undefined`",
2141cb0ef41Sopenharmony_ci                      "desc": "A function that accepts the `TestsStream` instance and can be used to setup listeners before any tests are run."
2151cb0ef41Sopenharmony_ci                    },
2161cb0ef41Sopenharmony_ci                    {
2171cb0ef41Sopenharmony_ci                      "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress test execution.",
2181cb0ef41Sopenharmony_ci                      "name": "signal",
2191cb0ef41Sopenharmony_ci                      "type": "AbortSignal",
2201cb0ef41Sopenharmony_ci                      "desc": "Allows aborting an in-progress test execution."
2211cb0ef41Sopenharmony_ci                    },
2221cb0ef41Sopenharmony_ci                    {
2231cb0ef41Sopenharmony_ci                      "textRaw": "`testNamePatterns` {string|RegExp|Array} A String, RegExp or a RegExp Array, that can be used to only run tests whose name matches the provided pattern. Test name patterns are interpreted as JavaScript regular expressions. For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run. **Default:** `undefined`.",
2241cb0ef41Sopenharmony_ci                      "name": "testNamePatterns",
2251cb0ef41Sopenharmony_ci                      "type": "string|RegExp|Array",
2261cb0ef41Sopenharmony_ci                      "default": "`undefined`",
2271cb0ef41Sopenharmony_ci                      "desc": "A String, RegExp or a RegExp Array, that can be used to only run tests whose name matches the provided pattern. Test name patterns are interpreted as JavaScript regular expressions. For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run."
2281cb0ef41Sopenharmony_ci                    },
2291cb0ef41Sopenharmony_ci                    {
2301cb0ef41Sopenharmony_ci                      "textRaw": "`timeout` {number} A number of milliseconds the test execution will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
2311cb0ef41Sopenharmony_ci                      "name": "timeout",
2321cb0ef41Sopenharmony_ci                      "type": "number",
2331cb0ef41Sopenharmony_ci                      "default": "`Infinity`",
2341cb0ef41Sopenharmony_ci                      "desc": "A number of milliseconds the test execution will fail after. If unspecified, subtests inherit this value from their parent."
2351cb0ef41Sopenharmony_ci                    },
2361cb0ef41Sopenharmony_ci                    {
2371cb0ef41Sopenharmony_ci                      "textRaw": "`watch` {boolean} Whether to run in watch mode or not. **Default:** `false`.",
2381cb0ef41Sopenharmony_ci                      "name": "watch",
2391cb0ef41Sopenharmony_ci                      "type": "boolean",
2401cb0ef41Sopenharmony_ci                      "default": "`false`",
2411cb0ef41Sopenharmony_ci                      "desc": "Whether to run in watch mode or not."
2421cb0ef41Sopenharmony_ci                    },
2431cb0ef41Sopenharmony_ci                    {
2441cb0ef41Sopenharmony_ci                      "textRaw": "`shard` {Object} Running tests in a specific shard. **Default:** `undefined`.",
2451cb0ef41Sopenharmony_ci                      "name": "shard",
2461cb0ef41Sopenharmony_ci                      "type": "Object",
2471cb0ef41Sopenharmony_ci                      "default": "`undefined`",
2481cb0ef41Sopenharmony_ci                      "desc": "Running tests in a specific shard.",
2491cb0ef41Sopenharmony_ci                      "options": [
2501cb0ef41Sopenharmony_ci                        {
2511cb0ef41Sopenharmony_ci                          "textRaw": "`index` {number} is a positive integer between 1 and `<total>` that specifies the index of the shard to run. This option is _required_.",
2521cb0ef41Sopenharmony_ci                          "name": "index",
2531cb0ef41Sopenharmony_ci                          "type": "number",
2541cb0ef41Sopenharmony_ci                          "desc": "is a positive integer between 1 and `<total>` that specifies the index of the shard to run. This option is _required_."
2551cb0ef41Sopenharmony_ci                        },
2561cb0ef41Sopenharmony_ci                        {
2571cb0ef41Sopenharmony_ci                          "textRaw": "`total` {number} is a positive integer that specifies the total number of shards to split the test files to. This option is _required_.",
2581cb0ef41Sopenharmony_ci                          "name": "total",
2591cb0ef41Sopenharmony_ci                          "type": "number",
2601cb0ef41Sopenharmony_ci                          "desc": "is a positive integer that specifies the total number of shards to split the test files to. This option is _required_."
2611cb0ef41Sopenharmony_ci                        }
2621cb0ef41Sopenharmony_ci                      ]
2631cb0ef41Sopenharmony_ci                    }
2641cb0ef41Sopenharmony_ci                  ]
2651cb0ef41Sopenharmony_ci                }
2661cb0ef41Sopenharmony_ci              ]
2671cb0ef41Sopenharmony_ci            }
2681cb0ef41Sopenharmony_ci          ],
2691cb0ef41Sopenharmony_ci          "desc": "<pre><code class=\"language-mjs\">import { tap } from 'node:test/reporters';\nimport process from 'node:process';\n\nrun({ files: [path.resolve('./tests/test.js')] })\n  .compose(tap)\n  .pipe(process.stdout);\n</code></pre>\n<pre><code class=\"language-cjs\">const { tap } = require('node:test/reporters');\n\nrun({ files: [path.resolve('./tests/test.js')] })\n  .compose(tap)\n  .pipe(process.stdout);\n</code></pre>"
2701cb0ef41Sopenharmony_ci        },
2711cb0ef41Sopenharmony_ci        {
2721cb0ef41Sopenharmony_ci          "textRaw": "`test([name][, options][, fn])`",
2731cb0ef41Sopenharmony_ci          "type": "method",
2741cb0ef41Sopenharmony_ci          "name": "test",
2751cb0ef41Sopenharmony_ci          "meta": {
2761cb0ef41Sopenharmony_ci            "added": [
2771cb0ef41Sopenharmony_ci              "v18.0.0"
2781cb0ef41Sopenharmony_ci            ],
2791cb0ef41Sopenharmony_ci            "changes": [
2801cb0ef41Sopenharmony_ci              {
2811cb0ef41Sopenharmony_ci                "version": "v18.17.0",
2821cb0ef41Sopenharmony_ci                "pr-url": "https://github.com/nodejs/node/pull/47909",
2831cb0ef41Sopenharmony_ci                "description": "Added the `skip`, `todo`, and `only` shorthands."
2841cb0ef41Sopenharmony_ci              },
2851cb0ef41Sopenharmony_ci              {
2861cb0ef41Sopenharmony_ci                "version": "v18.8.0",
2871cb0ef41Sopenharmony_ci                "pr-url": "https://github.com/nodejs/node/pull/43554",
2881cb0ef41Sopenharmony_ci                "description": "Add a `signal` option."
2891cb0ef41Sopenharmony_ci              },
2901cb0ef41Sopenharmony_ci              {
2911cb0ef41Sopenharmony_ci                "version": "v18.7.0",
2921cb0ef41Sopenharmony_ci                "pr-url": "https://github.com/nodejs/node/pull/43505",
2931cb0ef41Sopenharmony_ci                "description": "Add a `timeout` option."
2941cb0ef41Sopenharmony_ci              }
2951cb0ef41Sopenharmony_ci            ]
2961cb0ef41Sopenharmony_ci          },
2971cb0ef41Sopenharmony_ci          "signatures": [
2981cb0ef41Sopenharmony_ci            {
2991cb0ef41Sopenharmony_ci              "return": {
3001cb0ef41Sopenharmony_ci                "textRaw": "Returns: {Promise} Resolved with `undefined` once the test completes, or immediately if the test runs within [`describe()`][].",
3011cb0ef41Sopenharmony_ci                "name": "return",
3021cb0ef41Sopenharmony_ci                "type": "Promise",
3031cb0ef41Sopenharmony_ci                "desc": "Resolved with `undefined` once the test completes, or immediately if the test runs within [`describe()`][]."
3041cb0ef41Sopenharmony_ci              },
3051cb0ef41Sopenharmony_ci              "params": [
3061cb0ef41Sopenharmony_ci                {
3071cb0ef41Sopenharmony_ci                  "textRaw": "`name` {string} The name of the test, which is displayed when reporting test results. **Default:** The `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name.",
3081cb0ef41Sopenharmony_ci                  "name": "name",
3091cb0ef41Sopenharmony_ci                  "type": "string",
3101cb0ef41Sopenharmony_ci                  "default": "The `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name",
3111cb0ef41Sopenharmony_ci                  "desc": "The name of the test, which is displayed when reporting test results."
3121cb0ef41Sopenharmony_ci                },
3131cb0ef41Sopenharmony_ci                {
3141cb0ef41Sopenharmony_ci                  "textRaw": "`options` {Object} Configuration options for the test. The following properties are supported:",
3151cb0ef41Sopenharmony_ci                  "name": "options",
3161cb0ef41Sopenharmony_ci                  "type": "Object",
3171cb0ef41Sopenharmony_ci                  "desc": "Configuration options for the test. The following properties are supported:",
3181cb0ef41Sopenharmony_ci                  "options": [
3191cb0ef41Sopenharmony_ci                    {
3201cb0ef41Sopenharmony_ci                      "textRaw": "`concurrency` {number|boolean} If a number is provided, then that many tests would run in parallel within the application thread. If `true`, all scheduled asynchronous tests run concurrently within the thread. If `false`, only one test runs at a time. If unspecified, subtests inherit this value from their parent. **Default:** `false`.",
3211cb0ef41Sopenharmony_ci                      "name": "concurrency",
3221cb0ef41Sopenharmony_ci                      "type": "number|boolean",
3231cb0ef41Sopenharmony_ci                      "default": "`false`",
3241cb0ef41Sopenharmony_ci                      "desc": "If a number is provided, then that many tests would run in parallel within the application thread. If `true`, all scheduled asynchronous tests run concurrently within the thread. If `false`, only one test runs at a time. If unspecified, subtests inherit this value from their parent."
3251cb0ef41Sopenharmony_ci                    },
3261cb0ef41Sopenharmony_ci                    {
3271cb0ef41Sopenharmony_ci                      "textRaw": "`only` {boolean} If truthy, and the test context is configured to run `only` tests, then this test will be run. Otherwise, the test is skipped. **Default:** `false`.",
3281cb0ef41Sopenharmony_ci                      "name": "only",
3291cb0ef41Sopenharmony_ci                      "type": "boolean",
3301cb0ef41Sopenharmony_ci                      "default": "`false`",
3311cb0ef41Sopenharmony_ci                      "desc": "If truthy, and the test context is configured to run `only` tests, then this test will be run. Otherwise, the test is skipped."
3321cb0ef41Sopenharmony_ci                    },
3331cb0ef41Sopenharmony_ci                    {
3341cb0ef41Sopenharmony_ci                      "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress test.",
3351cb0ef41Sopenharmony_ci                      "name": "signal",
3361cb0ef41Sopenharmony_ci                      "type": "AbortSignal",
3371cb0ef41Sopenharmony_ci                      "desc": "Allows aborting an in-progress test."
3381cb0ef41Sopenharmony_ci                    },
3391cb0ef41Sopenharmony_ci                    {
3401cb0ef41Sopenharmony_ci                      "textRaw": "`skip` {boolean|string} If truthy, the test is skipped. If a string is provided, that string is displayed in the test results as the reason for skipping the test. **Default:** `false`.",
3411cb0ef41Sopenharmony_ci                      "name": "skip",
3421cb0ef41Sopenharmony_ci                      "type": "boolean|string",
3431cb0ef41Sopenharmony_ci                      "default": "`false`",
3441cb0ef41Sopenharmony_ci                      "desc": "If truthy, the test is skipped. If a string is provided, that string is displayed in the test results as the reason for skipping the test."
3451cb0ef41Sopenharmony_ci                    },
3461cb0ef41Sopenharmony_ci                    {
3471cb0ef41Sopenharmony_ci                      "textRaw": "`todo` {boolean|string} If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in the test results as the reason why the test is `TODO`. **Default:** `false`.",
3481cb0ef41Sopenharmony_ci                      "name": "todo",
3491cb0ef41Sopenharmony_ci                      "type": "boolean|string",
3501cb0ef41Sopenharmony_ci                      "default": "`false`",
3511cb0ef41Sopenharmony_ci                      "desc": "If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in the test results as the reason why the test is `TODO`."
3521cb0ef41Sopenharmony_ci                    },
3531cb0ef41Sopenharmony_ci                    {
3541cb0ef41Sopenharmony_ci                      "textRaw": "`timeout` {number} A number of milliseconds the test will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
3551cb0ef41Sopenharmony_ci                      "name": "timeout",
3561cb0ef41Sopenharmony_ci                      "type": "number",
3571cb0ef41Sopenharmony_ci                      "default": "`Infinity`",
3581cb0ef41Sopenharmony_ci                      "desc": "A number of milliseconds the test will fail after. If unspecified, subtests inherit this value from their parent."
3591cb0ef41Sopenharmony_ci                    }
3601cb0ef41Sopenharmony_ci                  ]
3611cb0ef41Sopenharmony_ci                },
3621cb0ef41Sopenharmony_ci                {
3631cb0ef41Sopenharmony_ci                  "textRaw": "`fn` {Function|AsyncFunction} The function under test. The first argument to this function is a [`TestContext`][] object. If the test uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
3641cb0ef41Sopenharmony_ci                  "name": "fn",
3651cb0ef41Sopenharmony_ci                  "type": "Function|AsyncFunction",
3661cb0ef41Sopenharmony_ci                  "default": "A no-op function",
3671cb0ef41Sopenharmony_ci                  "desc": "The function under test. The first argument to this function is a [`TestContext`][] object. If the test uses callbacks, the callback function is passed as the second argument."
3681cb0ef41Sopenharmony_ci                }
3691cb0ef41Sopenharmony_ci              ]
3701cb0ef41Sopenharmony_ci            }
3711cb0ef41Sopenharmony_ci          ],
3721cb0ef41Sopenharmony_ci          "desc": "<p>The <code>test()</code> function is the value imported from the <code>test</code> module. Each\ninvocation of this function results in reporting the test to the <a href=\"test.html#class-testsstream\" class=\"type\">&lt;TestsStream&gt;</a>.</p>\n<p>The <code>TestContext</code> object passed to the <code>fn</code> argument can be used to perform\nactions related to the current test. Examples include skipping the test, adding\nadditional diagnostic information, or creating subtests.</p>\n<p><code>test()</code> returns a <code>Promise</code> that resolves once the test completes.\nif <code>test()</code> is called within a <code>describe()</code> block, it resolve immediately.\nThe return value can usually be discarded for top level tests.\nHowever, the return value from subtests should be used to prevent the parent\ntest from finishing first and cancelling the subtest\nas shown in the following example.</p>\n<pre><code class=\"language-js\">test('top level test', async (t) => {\n  // The setTimeout() in the following subtest would cause it to outlive its\n  // parent test if 'await' is removed on the next line. Once the parent test\n  // completes, it will cancel any outstanding subtests.\n  await t.test('longer running subtest', async (t) => {\n    return new Promise((resolve, reject) => {\n      setTimeout(resolve, 1000);\n    });\n  });\n});\n</code></pre>\n<p>The <code>timeout</code> option can be used to fail the test if it takes longer than\n<code>timeout</code> milliseconds to complete. However, it is not a reliable mechanism for\ncanceling tests because a running test might block the application thread and\nthus prevent the scheduled cancellation.</p>"
3731cb0ef41Sopenharmony_ci        },
3741cb0ef41Sopenharmony_ci        {
3751cb0ef41Sopenharmony_ci          "textRaw": "`test.skip([name][, options][, fn])`",
3761cb0ef41Sopenharmony_ci          "type": "method",
3771cb0ef41Sopenharmony_ci          "name": "skip",
3781cb0ef41Sopenharmony_ci          "signatures": [
3791cb0ef41Sopenharmony_ci            {
3801cb0ef41Sopenharmony_ci              "params": []
3811cb0ef41Sopenharmony_ci            }
3821cb0ef41Sopenharmony_ci          ],
3831cb0ef41Sopenharmony_ci          "desc": "<p>Shorthand for skipping a test,\nsame as <a href=\"#testname-options-fn\"><code>test([name], { skip: true }[, fn])</code></a>.</p>"
3841cb0ef41Sopenharmony_ci        },
3851cb0ef41Sopenharmony_ci        {
3861cb0ef41Sopenharmony_ci          "textRaw": "`test.todo([name][, options][, fn])`",
3871cb0ef41Sopenharmony_ci          "type": "method",
3881cb0ef41Sopenharmony_ci          "name": "todo",
3891cb0ef41Sopenharmony_ci          "signatures": [
3901cb0ef41Sopenharmony_ci            {
3911cb0ef41Sopenharmony_ci              "params": []
3921cb0ef41Sopenharmony_ci            }
3931cb0ef41Sopenharmony_ci          ],
3941cb0ef41Sopenharmony_ci          "desc": "<p>Shorthand for marking a test as <code>TODO</code>,\nsame as <a href=\"#testname-options-fn\"><code>test([name], { todo: true }[, fn])</code></a>.</p>"
3951cb0ef41Sopenharmony_ci        },
3961cb0ef41Sopenharmony_ci        {
3971cb0ef41Sopenharmony_ci          "textRaw": "`test.only([name][, options][, fn])`",
3981cb0ef41Sopenharmony_ci          "type": "method",
3991cb0ef41Sopenharmony_ci          "name": "only",
4001cb0ef41Sopenharmony_ci          "signatures": [
4011cb0ef41Sopenharmony_ci            {
4021cb0ef41Sopenharmony_ci              "params": []
4031cb0ef41Sopenharmony_ci            }
4041cb0ef41Sopenharmony_ci          ],
4051cb0ef41Sopenharmony_ci          "desc": "<p>Shorthand for marking a test as <code>only</code>,\nsame as <a href=\"#testname-options-fn\"><code>test([name], { only: true }[, fn])</code></a>.</p>"
4061cb0ef41Sopenharmony_ci        },
4071cb0ef41Sopenharmony_ci        {
4081cb0ef41Sopenharmony_ci          "textRaw": "`describe([name][, options][, fn])`",
4091cb0ef41Sopenharmony_ci          "type": "method",
4101cb0ef41Sopenharmony_ci          "name": "describe",
4111cb0ef41Sopenharmony_ci          "signatures": [
4121cb0ef41Sopenharmony_ci            {
4131cb0ef41Sopenharmony_ci              "return": {
4141cb0ef41Sopenharmony_ci                "textRaw": "Returns: {Promise} Immediately fulfilled with `undefined`.",
4151cb0ef41Sopenharmony_ci                "name": "return",
4161cb0ef41Sopenharmony_ci                "type": "Promise",
4171cb0ef41Sopenharmony_ci                "desc": "Immediately fulfilled with `undefined`."
4181cb0ef41Sopenharmony_ci              },
4191cb0ef41Sopenharmony_ci              "params": [
4201cb0ef41Sopenharmony_ci                {
4211cb0ef41Sopenharmony_ci                  "textRaw": "`name` {string} The name of the suite, which is displayed when reporting test results. **Default:** The `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name.",
4221cb0ef41Sopenharmony_ci                  "name": "name",
4231cb0ef41Sopenharmony_ci                  "type": "string",
4241cb0ef41Sopenharmony_ci                  "default": "The `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name",
4251cb0ef41Sopenharmony_ci                  "desc": "The name of the suite, which is displayed when reporting test results."
4261cb0ef41Sopenharmony_ci                },
4271cb0ef41Sopenharmony_ci                {
4281cb0ef41Sopenharmony_ci                  "textRaw": "`options` {Object} Configuration options for the suite. supports the same options as `test([name][, options][, fn])`.",
4291cb0ef41Sopenharmony_ci                  "name": "options",
4301cb0ef41Sopenharmony_ci                  "type": "Object",
4311cb0ef41Sopenharmony_ci                  "desc": "Configuration options for the suite. supports the same options as `test([name][, options][, fn])`."
4321cb0ef41Sopenharmony_ci                },
4331cb0ef41Sopenharmony_ci                {
4341cb0ef41Sopenharmony_ci                  "textRaw": "`fn` {Function|AsyncFunction} The function under suite declaring all subtests and subsuites. The first argument to this function is a [`SuiteContext`][] object. **Default:** A no-op function.",
4351cb0ef41Sopenharmony_ci                  "name": "fn",
4361cb0ef41Sopenharmony_ci                  "type": "Function|AsyncFunction",
4371cb0ef41Sopenharmony_ci                  "default": "A no-op function",
4381cb0ef41Sopenharmony_ci                  "desc": "The function under suite declaring all subtests and subsuites. The first argument to this function is a [`SuiteContext`][] object."
4391cb0ef41Sopenharmony_ci                }
4401cb0ef41Sopenharmony_ci              ]
4411cb0ef41Sopenharmony_ci            }
4421cb0ef41Sopenharmony_ci          ],
4431cb0ef41Sopenharmony_ci          "desc": "<p>The <code>describe()</code> function imported from the <code>node:test</code> module. Each\ninvocation of this function results in the creation of a Subtest.\nAfter invocation of top level <code>describe</code> functions,\nall top level tests and suites will execute.</p>"
4441cb0ef41Sopenharmony_ci        },
4451cb0ef41Sopenharmony_ci        {
4461cb0ef41Sopenharmony_ci          "textRaw": "`describe.skip([name][, options][, fn])`",
4471cb0ef41Sopenharmony_ci          "type": "method",
4481cb0ef41Sopenharmony_ci          "name": "skip",
4491cb0ef41Sopenharmony_ci          "signatures": [
4501cb0ef41Sopenharmony_ci            {
4511cb0ef41Sopenharmony_ci              "params": []
4521cb0ef41Sopenharmony_ci            }
4531cb0ef41Sopenharmony_ci          ],
4541cb0ef41Sopenharmony_ci          "desc": "<p>Shorthand for skipping a suite, same as <a href=\"#describename-options-fn\"><code>describe([name], { skip: true }[, fn])</code></a>.</p>"
4551cb0ef41Sopenharmony_ci        },
4561cb0ef41Sopenharmony_ci        {
4571cb0ef41Sopenharmony_ci          "textRaw": "`describe.todo([name][, options][, fn])`",
4581cb0ef41Sopenharmony_ci          "type": "method",
4591cb0ef41Sopenharmony_ci          "name": "todo",
4601cb0ef41Sopenharmony_ci          "signatures": [
4611cb0ef41Sopenharmony_ci            {
4621cb0ef41Sopenharmony_ci              "params": []
4631cb0ef41Sopenharmony_ci            }
4641cb0ef41Sopenharmony_ci          ],
4651cb0ef41Sopenharmony_ci          "desc": "<p>Shorthand for marking a suite as <code>TODO</code>, same as\n<a href=\"#describename-options-fn\"><code>describe([name], { todo: true }[, fn])</code></a>.</p>"
4661cb0ef41Sopenharmony_ci        },
4671cb0ef41Sopenharmony_ci        {
4681cb0ef41Sopenharmony_ci          "textRaw": "`describe.only([name][, options][, fn])`",
4691cb0ef41Sopenharmony_ci          "type": "method",
4701cb0ef41Sopenharmony_ci          "name": "only",
4711cb0ef41Sopenharmony_ci          "meta": {
4721cb0ef41Sopenharmony_ci            "added": [
4731cb0ef41Sopenharmony_ci              "v18.15.0"
4741cb0ef41Sopenharmony_ci            ],
4751cb0ef41Sopenharmony_ci            "changes": []
4761cb0ef41Sopenharmony_ci          },
4771cb0ef41Sopenharmony_ci          "signatures": [
4781cb0ef41Sopenharmony_ci            {
4791cb0ef41Sopenharmony_ci              "params": []
4801cb0ef41Sopenharmony_ci            }
4811cb0ef41Sopenharmony_ci          ],
4821cb0ef41Sopenharmony_ci          "desc": "<p>Shorthand for marking a suite as <code>only</code>, same as\n<a href=\"#describename-options-fn\"><code>describe([name], { only: true }[, fn])</code></a>.</p>"
4831cb0ef41Sopenharmony_ci        },
4841cb0ef41Sopenharmony_ci        {
4851cb0ef41Sopenharmony_ci          "textRaw": "`it([name][, options][, fn])`",
4861cb0ef41Sopenharmony_ci          "type": "method",
4871cb0ef41Sopenharmony_ci          "name": "it",
4881cb0ef41Sopenharmony_ci          "meta": {
4891cb0ef41Sopenharmony_ci            "added": [
4901cb0ef41Sopenharmony_ci              "v18.6.0",
4911cb0ef41Sopenharmony_ci              "v16.17.0"
4921cb0ef41Sopenharmony_ci            ],
4931cb0ef41Sopenharmony_ci            "changes": [
4941cb0ef41Sopenharmony_ci              {
4951cb0ef41Sopenharmony_ci                "version": "v18.16.0",
4961cb0ef41Sopenharmony_ci                "pr-url": "https://github.com/nodejs/node/pull/46889",
4971cb0ef41Sopenharmony_ci                "description": "Calling `it()` is now equivalent to calling `test()`."
4981cb0ef41Sopenharmony_ci              }
4991cb0ef41Sopenharmony_ci            ]
5001cb0ef41Sopenharmony_ci          },
5011cb0ef41Sopenharmony_ci          "signatures": [
5021cb0ef41Sopenharmony_ci            {
5031cb0ef41Sopenharmony_ci              "params": []
5041cb0ef41Sopenharmony_ci            }
5051cb0ef41Sopenharmony_ci          ],
5061cb0ef41Sopenharmony_ci          "desc": "<p>Shorthand for <a href=\"#testname-options-fn\"><code>test()</code></a>.</p>\n<p>The <code>it()</code> function is imported from the <code>node:test</code> module.</p>"
5071cb0ef41Sopenharmony_ci        },
5081cb0ef41Sopenharmony_ci        {
5091cb0ef41Sopenharmony_ci          "textRaw": "`it.skip([name][, options][, fn])`",
5101cb0ef41Sopenharmony_ci          "type": "method",
5111cb0ef41Sopenharmony_ci          "name": "skip",
5121cb0ef41Sopenharmony_ci          "signatures": [
5131cb0ef41Sopenharmony_ci            {
5141cb0ef41Sopenharmony_ci              "params": []
5151cb0ef41Sopenharmony_ci            }
5161cb0ef41Sopenharmony_ci          ],
5171cb0ef41Sopenharmony_ci          "desc": "<p>Shorthand for skipping a test,\nsame as <a href=\"#testname-options-fn\"><code>it([name], { skip: true }[, fn])</code></a>.</p>"
5181cb0ef41Sopenharmony_ci        },
5191cb0ef41Sopenharmony_ci        {
5201cb0ef41Sopenharmony_ci          "textRaw": "`it.todo([name][, options][, fn])`",
5211cb0ef41Sopenharmony_ci          "type": "method",
5221cb0ef41Sopenharmony_ci          "name": "todo",
5231cb0ef41Sopenharmony_ci          "signatures": [
5241cb0ef41Sopenharmony_ci            {
5251cb0ef41Sopenharmony_ci              "params": []
5261cb0ef41Sopenharmony_ci            }
5271cb0ef41Sopenharmony_ci          ],
5281cb0ef41Sopenharmony_ci          "desc": "<p>Shorthand for marking a test as <code>TODO</code>,\nsame as <a href=\"#testname-options-fn\"><code>it([name], { todo: true }[, fn])</code></a>.</p>"
5291cb0ef41Sopenharmony_ci        },
5301cb0ef41Sopenharmony_ci        {
5311cb0ef41Sopenharmony_ci          "textRaw": "`it.only([name][, options][, fn])`",
5321cb0ef41Sopenharmony_ci          "type": "method",
5331cb0ef41Sopenharmony_ci          "name": "only",
5341cb0ef41Sopenharmony_ci          "meta": {
5351cb0ef41Sopenharmony_ci            "added": [
5361cb0ef41Sopenharmony_ci              "v18.15.0"
5371cb0ef41Sopenharmony_ci            ],
5381cb0ef41Sopenharmony_ci            "changes": []
5391cb0ef41Sopenharmony_ci          },
5401cb0ef41Sopenharmony_ci          "signatures": [
5411cb0ef41Sopenharmony_ci            {
5421cb0ef41Sopenharmony_ci              "params": []
5431cb0ef41Sopenharmony_ci            }
5441cb0ef41Sopenharmony_ci          ],
5451cb0ef41Sopenharmony_ci          "desc": "<p>Shorthand for marking a test as <code>only</code>,\nsame as <a href=\"#testname-options-fn\"><code>it([name], { only: true }[, fn])</code></a>.</p>"
5461cb0ef41Sopenharmony_ci        },
5471cb0ef41Sopenharmony_ci        {
5481cb0ef41Sopenharmony_ci          "textRaw": "`before([fn][, options])`",
5491cb0ef41Sopenharmony_ci          "type": "method",
5501cb0ef41Sopenharmony_ci          "name": "before",
5511cb0ef41Sopenharmony_ci          "meta": {
5521cb0ef41Sopenharmony_ci            "added": [
5531cb0ef41Sopenharmony_ci              "v18.8.0"
5541cb0ef41Sopenharmony_ci            ],
5551cb0ef41Sopenharmony_ci            "changes": []
5561cb0ef41Sopenharmony_ci          },
5571cb0ef41Sopenharmony_ci          "signatures": [
5581cb0ef41Sopenharmony_ci            {
5591cb0ef41Sopenharmony_ci              "params": [
5601cb0ef41Sopenharmony_ci                {
5611cb0ef41Sopenharmony_ci                  "textRaw": "`fn` {Function|AsyncFunction} The hook function. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
5621cb0ef41Sopenharmony_ci                  "name": "fn",
5631cb0ef41Sopenharmony_ci                  "type": "Function|AsyncFunction",
5641cb0ef41Sopenharmony_ci                  "default": "A no-op function",
5651cb0ef41Sopenharmony_ci                  "desc": "The hook function. If the hook uses callbacks, the callback function is passed as the second argument."
5661cb0ef41Sopenharmony_ci                },
5671cb0ef41Sopenharmony_ci                {
5681cb0ef41Sopenharmony_ci                  "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
5691cb0ef41Sopenharmony_ci                  "name": "options",
5701cb0ef41Sopenharmony_ci                  "type": "Object",
5711cb0ef41Sopenharmony_ci                  "desc": "Configuration options for the hook. The following properties are supported:",
5721cb0ef41Sopenharmony_ci                  "options": [
5731cb0ef41Sopenharmony_ci                    {
5741cb0ef41Sopenharmony_ci                      "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
5751cb0ef41Sopenharmony_ci                      "name": "signal",
5761cb0ef41Sopenharmony_ci                      "type": "AbortSignal",
5771cb0ef41Sopenharmony_ci                      "desc": "Allows aborting an in-progress hook."
5781cb0ef41Sopenharmony_ci                    },
5791cb0ef41Sopenharmony_ci                    {
5801cb0ef41Sopenharmony_ci                      "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
5811cb0ef41Sopenharmony_ci                      "name": "timeout",
5821cb0ef41Sopenharmony_ci                      "type": "number",
5831cb0ef41Sopenharmony_ci                      "default": "`Infinity`",
5841cb0ef41Sopenharmony_ci                      "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
5851cb0ef41Sopenharmony_ci                    }
5861cb0ef41Sopenharmony_ci                  ]
5871cb0ef41Sopenharmony_ci                }
5881cb0ef41Sopenharmony_ci              ]
5891cb0ef41Sopenharmony_ci            }
5901cb0ef41Sopenharmony_ci          ],
5911cb0ef41Sopenharmony_ci          "desc": "<p>This function is used to create a hook running before running a suite.</p>\n<pre><code class=\"language-js\">describe('tests', async () => {\n  before(() => console.log('about to run some test'));\n  it('is a subtest', () => {\n    assert.ok('some relevant assertion here');\n  });\n});\n</code></pre>"
5921cb0ef41Sopenharmony_ci        },
5931cb0ef41Sopenharmony_ci        {
5941cb0ef41Sopenharmony_ci          "textRaw": "`after([fn][, options])`",
5951cb0ef41Sopenharmony_ci          "type": "method",
5961cb0ef41Sopenharmony_ci          "name": "after",
5971cb0ef41Sopenharmony_ci          "meta": {
5981cb0ef41Sopenharmony_ci            "added": [
5991cb0ef41Sopenharmony_ci              "v18.8.0"
6001cb0ef41Sopenharmony_ci            ],
6011cb0ef41Sopenharmony_ci            "changes": []
6021cb0ef41Sopenharmony_ci          },
6031cb0ef41Sopenharmony_ci          "signatures": [
6041cb0ef41Sopenharmony_ci            {
6051cb0ef41Sopenharmony_ci              "params": [
6061cb0ef41Sopenharmony_ci                {
6071cb0ef41Sopenharmony_ci                  "textRaw": "`fn` {Function|AsyncFunction} The hook function. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
6081cb0ef41Sopenharmony_ci                  "name": "fn",
6091cb0ef41Sopenharmony_ci                  "type": "Function|AsyncFunction",
6101cb0ef41Sopenharmony_ci                  "default": "A no-op function",
6111cb0ef41Sopenharmony_ci                  "desc": "The hook function. If the hook uses callbacks, the callback function is passed as the second argument."
6121cb0ef41Sopenharmony_ci                },
6131cb0ef41Sopenharmony_ci                {
6141cb0ef41Sopenharmony_ci                  "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
6151cb0ef41Sopenharmony_ci                  "name": "options",
6161cb0ef41Sopenharmony_ci                  "type": "Object",
6171cb0ef41Sopenharmony_ci                  "desc": "Configuration options for the hook. The following properties are supported:",
6181cb0ef41Sopenharmony_ci                  "options": [
6191cb0ef41Sopenharmony_ci                    {
6201cb0ef41Sopenharmony_ci                      "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
6211cb0ef41Sopenharmony_ci                      "name": "signal",
6221cb0ef41Sopenharmony_ci                      "type": "AbortSignal",
6231cb0ef41Sopenharmony_ci                      "desc": "Allows aborting an in-progress hook."
6241cb0ef41Sopenharmony_ci                    },
6251cb0ef41Sopenharmony_ci                    {
6261cb0ef41Sopenharmony_ci                      "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
6271cb0ef41Sopenharmony_ci                      "name": "timeout",
6281cb0ef41Sopenharmony_ci                      "type": "number",
6291cb0ef41Sopenharmony_ci                      "default": "`Infinity`",
6301cb0ef41Sopenharmony_ci                      "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
6311cb0ef41Sopenharmony_ci                    }
6321cb0ef41Sopenharmony_ci                  ]
6331cb0ef41Sopenharmony_ci                }
6341cb0ef41Sopenharmony_ci              ]
6351cb0ef41Sopenharmony_ci            }
6361cb0ef41Sopenharmony_ci          ],
6371cb0ef41Sopenharmony_ci          "desc": "<p>This function is used to create a hook running after  running a suite.</p>\n<pre><code class=\"language-js\">describe('tests', async () => {\n  after(() => console.log('finished running tests'));\n  it('is a subtest', () => {\n    assert.ok('some relevant assertion here');\n  });\n});\n</code></pre>"
6381cb0ef41Sopenharmony_ci        },
6391cb0ef41Sopenharmony_ci        {
6401cb0ef41Sopenharmony_ci          "textRaw": "`beforeEach([fn][, options])`",
6411cb0ef41Sopenharmony_ci          "type": "method",
6421cb0ef41Sopenharmony_ci          "name": "beforeEach",
6431cb0ef41Sopenharmony_ci          "meta": {
6441cb0ef41Sopenharmony_ci            "added": [
6451cb0ef41Sopenharmony_ci              "v18.8.0"
6461cb0ef41Sopenharmony_ci            ],
6471cb0ef41Sopenharmony_ci            "changes": []
6481cb0ef41Sopenharmony_ci          },
6491cb0ef41Sopenharmony_ci          "signatures": [
6501cb0ef41Sopenharmony_ci            {
6511cb0ef41Sopenharmony_ci              "params": [
6521cb0ef41Sopenharmony_ci                {
6531cb0ef41Sopenharmony_ci                  "textRaw": "`fn` {Function|AsyncFunction} The hook function. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
6541cb0ef41Sopenharmony_ci                  "name": "fn",
6551cb0ef41Sopenharmony_ci                  "type": "Function|AsyncFunction",
6561cb0ef41Sopenharmony_ci                  "default": "A no-op function",
6571cb0ef41Sopenharmony_ci                  "desc": "The hook function. If the hook uses callbacks, the callback function is passed as the second argument."
6581cb0ef41Sopenharmony_ci                },
6591cb0ef41Sopenharmony_ci                {
6601cb0ef41Sopenharmony_ci                  "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
6611cb0ef41Sopenharmony_ci                  "name": "options",
6621cb0ef41Sopenharmony_ci                  "type": "Object",
6631cb0ef41Sopenharmony_ci                  "desc": "Configuration options for the hook. The following properties are supported:",
6641cb0ef41Sopenharmony_ci                  "options": [
6651cb0ef41Sopenharmony_ci                    {
6661cb0ef41Sopenharmony_ci                      "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
6671cb0ef41Sopenharmony_ci                      "name": "signal",
6681cb0ef41Sopenharmony_ci                      "type": "AbortSignal",
6691cb0ef41Sopenharmony_ci                      "desc": "Allows aborting an in-progress hook."
6701cb0ef41Sopenharmony_ci                    },
6711cb0ef41Sopenharmony_ci                    {
6721cb0ef41Sopenharmony_ci                      "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
6731cb0ef41Sopenharmony_ci                      "name": "timeout",
6741cb0ef41Sopenharmony_ci                      "type": "number",
6751cb0ef41Sopenharmony_ci                      "default": "`Infinity`",
6761cb0ef41Sopenharmony_ci                      "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
6771cb0ef41Sopenharmony_ci                    }
6781cb0ef41Sopenharmony_ci                  ]
6791cb0ef41Sopenharmony_ci                }
6801cb0ef41Sopenharmony_ci              ]
6811cb0ef41Sopenharmony_ci            }
6821cb0ef41Sopenharmony_ci          ],
6831cb0ef41Sopenharmony_ci          "desc": "<p>This function is used to create a hook running\nbefore each subtest of the current suite.</p>\n<pre><code class=\"language-js\">describe('tests', async () => {\n  beforeEach(() => console.log('about to run a test'));\n  it('is a subtest', () => {\n    assert.ok('some relevant assertion here');\n  });\n});\n</code></pre>"
6841cb0ef41Sopenharmony_ci        },
6851cb0ef41Sopenharmony_ci        {
6861cb0ef41Sopenharmony_ci          "textRaw": "`afterEach([fn][, options])`",
6871cb0ef41Sopenharmony_ci          "type": "method",
6881cb0ef41Sopenharmony_ci          "name": "afterEach",
6891cb0ef41Sopenharmony_ci          "meta": {
6901cb0ef41Sopenharmony_ci            "added": [
6911cb0ef41Sopenharmony_ci              "v18.8.0"
6921cb0ef41Sopenharmony_ci            ],
6931cb0ef41Sopenharmony_ci            "changes": []
6941cb0ef41Sopenharmony_ci          },
6951cb0ef41Sopenharmony_ci          "signatures": [
6961cb0ef41Sopenharmony_ci            {
6971cb0ef41Sopenharmony_ci              "params": [
6981cb0ef41Sopenharmony_ci                {
6991cb0ef41Sopenharmony_ci                  "textRaw": "`fn` {Function|AsyncFunction} The hook function. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
7001cb0ef41Sopenharmony_ci                  "name": "fn",
7011cb0ef41Sopenharmony_ci                  "type": "Function|AsyncFunction",
7021cb0ef41Sopenharmony_ci                  "default": "A no-op function",
7031cb0ef41Sopenharmony_ci                  "desc": "The hook function. If the hook uses callbacks, the callback function is passed as the second argument."
7041cb0ef41Sopenharmony_ci                },
7051cb0ef41Sopenharmony_ci                {
7061cb0ef41Sopenharmony_ci                  "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
7071cb0ef41Sopenharmony_ci                  "name": "options",
7081cb0ef41Sopenharmony_ci                  "type": "Object",
7091cb0ef41Sopenharmony_ci                  "desc": "Configuration options for the hook. The following properties are supported:",
7101cb0ef41Sopenharmony_ci                  "options": [
7111cb0ef41Sopenharmony_ci                    {
7121cb0ef41Sopenharmony_ci                      "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
7131cb0ef41Sopenharmony_ci                      "name": "signal",
7141cb0ef41Sopenharmony_ci                      "type": "AbortSignal",
7151cb0ef41Sopenharmony_ci                      "desc": "Allows aborting an in-progress hook."
7161cb0ef41Sopenharmony_ci                    },
7171cb0ef41Sopenharmony_ci                    {
7181cb0ef41Sopenharmony_ci                      "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
7191cb0ef41Sopenharmony_ci                      "name": "timeout",
7201cb0ef41Sopenharmony_ci                      "type": "number",
7211cb0ef41Sopenharmony_ci                      "default": "`Infinity`",
7221cb0ef41Sopenharmony_ci                      "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
7231cb0ef41Sopenharmony_ci                    }
7241cb0ef41Sopenharmony_ci                  ]
7251cb0ef41Sopenharmony_ci                }
7261cb0ef41Sopenharmony_ci              ]
7271cb0ef41Sopenharmony_ci            }
7281cb0ef41Sopenharmony_ci          ],
7291cb0ef41Sopenharmony_ci          "desc": "<p>This function is used to create a hook running\nafter each subtest of the current test.</p>\n<pre><code class=\"language-js\">describe('tests', async () => {\n  afterEach(() => console.log('finished running a test'));\n  it('is a subtest', () => {\n    assert.ok('some relevant assertion here');\n  });\n});\n</code></pre>"
7301cb0ef41Sopenharmony_ci        }
7311cb0ef41Sopenharmony_ci      ],
7321cb0ef41Sopenharmony_ci      "classes": [
7331cb0ef41Sopenharmony_ci        {
7341cb0ef41Sopenharmony_ci          "textRaw": "Class: `MockFunctionContext`",
7351cb0ef41Sopenharmony_ci          "type": "class",
7361cb0ef41Sopenharmony_ci          "name": "MockFunctionContext",
7371cb0ef41Sopenharmony_ci          "meta": {
7381cb0ef41Sopenharmony_ci            "added": [
7391cb0ef41Sopenharmony_ci              "v18.13.0"
7401cb0ef41Sopenharmony_ci            ],
7411cb0ef41Sopenharmony_ci            "changes": []
7421cb0ef41Sopenharmony_ci          },
7431cb0ef41Sopenharmony_ci          "desc": "<p>The <code>MockFunctionContext</code> class is used to inspect or manipulate the behavior of\nmocks created via the <a href=\"#class-mocktracker\"><code>MockTracker</code></a> APIs.</p>",
7441cb0ef41Sopenharmony_ci          "properties": [
7451cb0ef41Sopenharmony_ci            {
7461cb0ef41Sopenharmony_ci              "textRaw": "`calls` {Array}",
7471cb0ef41Sopenharmony_ci              "type": "Array",
7481cb0ef41Sopenharmony_ci              "name": "calls",
7491cb0ef41Sopenharmony_ci              "meta": {
7501cb0ef41Sopenharmony_ci                "added": [
7511cb0ef41Sopenharmony_ci                  "v18.13.0"
7521cb0ef41Sopenharmony_ci                ],
7531cb0ef41Sopenharmony_ci                "changes": []
7541cb0ef41Sopenharmony_ci              },
7551cb0ef41Sopenharmony_ci              "desc": "<p>A getter that returns a copy of the internal array used to track calls to the\nmock. Each entry in the array is an object with the following properties.</p>\n<ul>\n<li><code>arguments</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type\">&lt;Array&gt;</a> An array of the arguments passed to the mock function.</li>\n<li><code>error</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types\" class=\"type\">&lt;any&gt;</a> If the mocked function threw then this property contains the\nthrown value. <strong>Default:</strong> <code>undefined</code>.</li>\n<li><code>result</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types\" class=\"type\">&lt;any&gt;</a> The value returned by the mocked function.</li>\n<li><code>stack</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\" class=\"type\">&lt;Error&gt;</a> An <code>Error</code> object whose stack can be used to determine the\ncallsite of the mocked function invocation.</li>\n<li><code>target</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\">&lt;Function&gt;</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type\" class=\"type\">&lt;undefined&gt;</a> If the mocked function is a constructor, this\nfield contains the class being constructed. Otherwise this will be\n<code>undefined</code>.</li>\n<li><code>this</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types\" class=\"type\">&lt;any&gt;</a> The mocked function's <code>this</code> value.</li>\n</ul>"
7561cb0ef41Sopenharmony_ci            }
7571cb0ef41Sopenharmony_ci          ],
7581cb0ef41Sopenharmony_ci          "methods": [
7591cb0ef41Sopenharmony_ci            {
7601cb0ef41Sopenharmony_ci              "textRaw": "`ctx.callCount()`",
7611cb0ef41Sopenharmony_ci              "type": "method",
7621cb0ef41Sopenharmony_ci              "name": "callCount",
7631cb0ef41Sopenharmony_ci              "meta": {
7641cb0ef41Sopenharmony_ci                "added": [
7651cb0ef41Sopenharmony_ci                  "v18.13.0"
7661cb0ef41Sopenharmony_ci                ],
7671cb0ef41Sopenharmony_ci                "changes": []
7681cb0ef41Sopenharmony_ci              },
7691cb0ef41Sopenharmony_ci              "signatures": [
7701cb0ef41Sopenharmony_ci                {
7711cb0ef41Sopenharmony_ci                  "return": {
7721cb0ef41Sopenharmony_ci                    "textRaw": "Returns: {integer} The number of times that this mock has been invoked.",
7731cb0ef41Sopenharmony_ci                    "name": "return",
7741cb0ef41Sopenharmony_ci                    "type": "integer",
7751cb0ef41Sopenharmony_ci                    "desc": "The number of times that this mock has been invoked."
7761cb0ef41Sopenharmony_ci                  },
7771cb0ef41Sopenharmony_ci                  "params": []
7781cb0ef41Sopenharmony_ci                }
7791cb0ef41Sopenharmony_ci              ],
7801cb0ef41Sopenharmony_ci              "desc": "<p>This function returns the number of times that this mock has been invoked. This\nfunction is more efficient than checking <code>ctx.calls.length</code> because <code>ctx.calls</code>\nis a getter that creates a copy of the internal call tracking array.</p>"
7811cb0ef41Sopenharmony_ci            },
7821cb0ef41Sopenharmony_ci            {
7831cb0ef41Sopenharmony_ci              "textRaw": "`ctx.mockImplementation(implementation)`",
7841cb0ef41Sopenharmony_ci              "type": "method",
7851cb0ef41Sopenharmony_ci              "name": "mockImplementation",
7861cb0ef41Sopenharmony_ci              "meta": {
7871cb0ef41Sopenharmony_ci                "added": [
7881cb0ef41Sopenharmony_ci                  "v18.13.0"
7891cb0ef41Sopenharmony_ci                ],
7901cb0ef41Sopenharmony_ci                "changes": []
7911cb0ef41Sopenharmony_ci              },
7921cb0ef41Sopenharmony_ci              "signatures": [
7931cb0ef41Sopenharmony_ci                {
7941cb0ef41Sopenharmony_ci                  "params": [
7951cb0ef41Sopenharmony_ci                    {
7961cb0ef41Sopenharmony_ci                      "textRaw": "`implementation` {Function|AsyncFunction} The function to be used as the mock's new implementation.",
7971cb0ef41Sopenharmony_ci                      "name": "implementation",
7981cb0ef41Sopenharmony_ci                      "type": "Function|AsyncFunction",
7991cb0ef41Sopenharmony_ci                      "desc": "The function to be used as the mock's new implementation."
8001cb0ef41Sopenharmony_ci                    }
8011cb0ef41Sopenharmony_ci                  ]
8021cb0ef41Sopenharmony_ci                }
8031cb0ef41Sopenharmony_ci              ],
8041cb0ef41Sopenharmony_ci              "desc": "<p>This function is used to change the behavior of an existing mock.</p>\n<p>The following example creates a mock function using <code>t.mock.fn()</code>, calls the\nmock function, and then changes the mock implementation to a different function.</p>\n<pre><code class=\"language-js\">test('changes a mock behavior', (t) => {\n  let cnt = 0;\n\n  function addOne() {\n    cnt++;\n    return cnt;\n  }\n\n  function addTwo() {\n    cnt += 2;\n    return cnt;\n  }\n\n  const fn = t.mock.fn(addOne);\n\n  assert.strictEqual(fn(), 1);\n  fn.mock.mockImplementation(addTwo);\n  assert.strictEqual(fn(), 3);\n  assert.strictEqual(fn(), 5);\n});\n</code></pre>"
8051cb0ef41Sopenharmony_ci            },
8061cb0ef41Sopenharmony_ci            {
8071cb0ef41Sopenharmony_ci              "textRaw": "`ctx.mockImplementationOnce(implementation[, onCall])`",
8081cb0ef41Sopenharmony_ci              "type": "method",
8091cb0ef41Sopenharmony_ci              "name": "mockImplementationOnce",
8101cb0ef41Sopenharmony_ci              "meta": {
8111cb0ef41Sopenharmony_ci                "added": [
8121cb0ef41Sopenharmony_ci                  "v18.13.0"
8131cb0ef41Sopenharmony_ci                ],
8141cb0ef41Sopenharmony_ci                "changes": []
8151cb0ef41Sopenharmony_ci              },
8161cb0ef41Sopenharmony_ci              "signatures": [
8171cb0ef41Sopenharmony_ci                {
8181cb0ef41Sopenharmony_ci                  "params": [
8191cb0ef41Sopenharmony_ci                    {
8201cb0ef41Sopenharmony_ci                      "textRaw": "`implementation` {Function|AsyncFunction} The function to be used as the mock's implementation for the invocation number specified by `onCall`.",
8211cb0ef41Sopenharmony_ci                      "name": "implementation",
8221cb0ef41Sopenharmony_ci                      "type": "Function|AsyncFunction",
8231cb0ef41Sopenharmony_ci                      "desc": "The function to be used as the mock's implementation for the invocation number specified by `onCall`."
8241cb0ef41Sopenharmony_ci                    },
8251cb0ef41Sopenharmony_ci                    {
8261cb0ef41Sopenharmony_ci                      "textRaw": "`onCall` {integer} The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown. **Default:** The number of the next invocation.",
8271cb0ef41Sopenharmony_ci                      "name": "onCall",
8281cb0ef41Sopenharmony_ci                      "type": "integer",
8291cb0ef41Sopenharmony_ci                      "default": "The number of the next invocation",
8301cb0ef41Sopenharmony_ci                      "desc": "The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown."
8311cb0ef41Sopenharmony_ci                    }
8321cb0ef41Sopenharmony_ci                  ]
8331cb0ef41Sopenharmony_ci                }
8341cb0ef41Sopenharmony_ci              ],
8351cb0ef41Sopenharmony_ci              "desc": "<p>This function is used to change the behavior of an existing mock for a single\ninvocation. Once invocation <code>onCall</code> has occurred, the mock will revert to\nwhatever behavior it would have used had <code>mockImplementationOnce()</code> not been\ncalled.</p>\n<p>The following example creates a mock function using <code>t.mock.fn()</code>, calls the\nmock function, changes the mock implementation to a different function for the\nnext invocation, and then resumes its previous behavior.</p>\n<pre><code class=\"language-js\">test('changes a mock behavior once', (t) => {\n  let cnt = 0;\n\n  function addOne() {\n    cnt++;\n    return cnt;\n  }\n\n  function addTwo() {\n    cnt += 2;\n    return cnt;\n  }\n\n  const fn = t.mock.fn(addOne);\n\n  assert.strictEqual(fn(), 1);\n  fn.mock.mockImplementationOnce(addTwo);\n  assert.strictEqual(fn(), 3);\n  assert.strictEqual(fn(), 4);\n});\n</code></pre>"
8361cb0ef41Sopenharmony_ci            },
8371cb0ef41Sopenharmony_ci            {
8381cb0ef41Sopenharmony_ci              "textRaw": "`ctx.resetCalls()`",
8391cb0ef41Sopenharmony_ci              "type": "method",
8401cb0ef41Sopenharmony_ci              "name": "resetCalls",
8411cb0ef41Sopenharmony_ci              "meta": {
8421cb0ef41Sopenharmony_ci                "added": [
8431cb0ef41Sopenharmony_ci                  "v18.13.0"
8441cb0ef41Sopenharmony_ci                ],
8451cb0ef41Sopenharmony_ci                "changes": []
8461cb0ef41Sopenharmony_ci              },
8471cb0ef41Sopenharmony_ci              "signatures": [
8481cb0ef41Sopenharmony_ci                {
8491cb0ef41Sopenharmony_ci                  "params": []
8501cb0ef41Sopenharmony_ci                }
8511cb0ef41Sopenharmony_ci              ],
8521cb0ef41Sopenharmony_ci              "desc": "<p>Resets the call history of the mock function.</p>"
8531cb0ef41Sopenharmony_ci            },
8541cb0ef41Sopenharmony_ci            {
8551cb0ef41Sopenharmony_ci              "textRaw": "`ctx.restore()`",
8561cb0ef41Sopenharmony_ci              "type": "method",
8571cb0ef41Sopenharmony_ci              "name": "restore",
8581cb0ef41Sopenharmony_ci              "meta": {
8591cb0ef41Sopenharmony_ci                "added": [
8601cb0ef41Sopenharmony_ci                  "v18.13.0"
8611cb0ef41Sopenharmony_ci                ],
8621cb0ef41Sopenharmony_ci                "changes": []
8631cb0ef41Sopenharmony_ci              },
8641cb0ef41Sopenharmony_ci              "signatures": [
8651cb0ef41Sopenharmony_ci                {
8661cb0ef41Sopenharmony_ci                  "params": []
8671cb0ef41Sopenharmony_ci                }
8681cb0ef41Sopenharmony_ci              ],
8691cb0ef41Sopenharmony_ci              "desc": "<p>Resets the implementation of the mock function to its original behavior. The\nmock can still be used after calling this function.</p>"
8701cb0ef41Sopenharmony_ci            }
8711cb0ef41Sopenharmony_ci          ]
8721cb0ef41Sopenharmony_ci        },
8731cb0ef41Sopenharmony_ci        {
8741cb0ef41Sopenharmony_ci          "textRaw": "Class: `MockTracker`",
8751cb0ef41Sopenharmony_ci          "type": "class",
8761cb0ef41Sopenharmony_ci          "name": "MockTracker",
8771cb0ef41Sopenharmony_ci          "meta": {
8781cb0ef41Sopenharmony_ci            "added": [
8791cb0ef41Sopenharmony_ci              "v18.13.0"
8801cb0ef41Sopenharmony_ci            ],
8811cb0ef41Sopenharmony_ci            "changes": []
8821cb0ef41Sopenharmony_ci          },
8831cb0ef41Sopenharmony_ci          "desc": "<p>The <code>MockTracker</code> class is used to manage mocking functionality. The test runner\nmodule provides a top level <code>mock</code> export which is a <code>MockTracker</code> instance.\nEach test also provides its own <code>MockTracker</code> instance via the test context's\n<code>mock</code> property.</p>",
8841cb0ef41Sopenharmony_ci          "methods": [
8851cb0ef41Sopenharmony_ci            {
8861cb0ef41Sopenharmony_ci              "textRaw": "`mock.fn([original[, implementation]][, options])`",
8871cb0ef41Sopenharmony_ci              "type": "method",
8881cb0ef41Sopenharmony_ci              "name": "fn",
8891cb0ef41Sopenharmony_ci              "meta": {
8901cb0ef41Sopenharmony_ci                "added": [
8911cb0ef41Sopenharmony_ci                  "v18.13.0"
8921cb0ef41Sopenharmony_ci                ],
8931cb0ef41Sopenharmony_ci                "changes": []
8941cb0ef41Sopenharmony_ci              },
8951cb0ef41Sopenharmony_ci              "signatures": [
8961cb0ef41Sopenharmony_ci                {
8971cb0ef41Sopenharmony_ci                  "return": {
8981cb0ef41Sopenharmony_ci                    "textRaw": "Returns: {Proxy} The mocked function. The mocked function contains a special `mock` property, which is an instance of [`MockFunctionContext`][], and can be used for inspecting and changing the behavior of the mocked function.",
8991cb0ef41Sopenharmony_ci                    "name": "return",
9001cb0ef41Sopenharmony_ci                    "type": "Proxy",
9011cb0ef41Sopenharmony_ci                    "desc": "The mocked function. The mocked function contains a special `mock` property, which is an instance of [`MockFunctionContext`][], and can be used for inspecting and changing the behavior of the mocked function."
9021cb0ef41Sopenharmony_ci                  },
9031cb0ef41Sopenharmony_ci                  "params": [
9041cb0ef41Sopenharmony_ci                    {
9051cb0ef41Sopenharmony_ci                      "textRaw": "`original` {Function|AsyncFunction} An optional function to create a mock on. **Default:** A no-op function.",
9061cb0ef41Sopenharmony_ci                      "name": "original",
9071cb0ef41Sopenharmony_ci                      "type": "Function|AsyncFunction",
9081cb0ef41Sopenharmony_ci                      "default": "A no-op function",
9091cb0ef41Sopenharmony_ci                      "desc": "An optional function to create a mock on."
9101cb0ef41Sopenharmony_ci                    },
9111cb0ef41Sopenharmony_ci                    {
9121cb0ef41Sopenharmony_ci                      "textRaw": "`implementation` {Function|AsyncFunction} An optional function used as the mock implementation for `original`. This is useful for creating mocks that exhibit one behavior for a specified number of calls and then restore the behavior of `original`. **Default:** The function specified by `original`.",
9131cb0ef41Sopenharmony_ci                      "name": "implementation",
9141cb0ef41Sopenharmony_ci                      "type": "Function|AsyncFunction",
9151cb0ef41Sopenharmony_ci                      "default": "The function specified by `original`",
9161cb0ef41Sopenharmony_ci                      "desc": "An optional function used as the mock implementation for `original`. This is useful for creating mocks that exhibit one behavior for a specified number of calls and then restore the behavior of `original`."
9171cb0ef41Sopenharmony_ci                    },
9181cb0ef41Sopenharmony_ci                    {
9191cb0ef41Sopenharmony_ci                      "textRaw": "`options` {Object} Optional configuration options for the mock function. The following properties are supported:",
9201cb0ef41Sopenharmony_ci                      "name": "options",
9211cb0ef41Sopenharmony_ci                      "type": "Object",
9221cb0ef41Sopenharmony_ci                      "desc": "Optional configuration options for the mock function. The following properties are supported:",
9231cb0ef41Sopenharmony_ci                      "options": [
9241cb0ef41Sopenharmony_ci                        {
9251cb0ef41Sopenharmony_ci                          "textRaw": "`times` {integer} The number of times that the mock will use the behavior of `implementation`. Once the mock function has been called `times` times, it will automatically restore the behavior of `original`. This value must be an integer greater than zero. **Default:** `Infinity`.",
9261cb0ef41Sopenharmony_ci                          "name": "times",
9271cb0ef41Sopenharmony_ci                          "type": "integer",
9281cb0ef41Sopenharmony_ci                          "default": "`Infinity`",
9291cb0ef41Sopenharmony_ci                          "desc": "The number of times that the mock will use the behavior of `implementation`. Once the mock function has been called `times` times, it will automatically restore the behavior of `original`. This value must be an integer greater than zero."
9301cb0ef41Sopenharmony_ci                        }
9311cb0ef41Sopenharmony_ci                      ]
9321cb0ef41Sopenharmony_ci                    }
9331cb0ef41Sopenharmony_ci                  ]
9341cb0ef41Sopenharmony_ci                }
9351cb0ef41Sopenharmony_ci              ],
9361cb0ef41Sopenharmony_ci              "desc": "<p>This function is used to create a mock function.</p>\n<p>The following example creates a mock function that increments a counter by one\non each invocation. The <code>times</code> option is used to modify the mock behavior such\nthat the first two invocations add two to the counter instead of one.</p>\n<pre><code class=\"language-js\">test('mocks a counting function', (t) => {\n  let cnt = 0;\n\n  function addOne() {\n    cnt++;\n    return cnt;\n  }\n\n  function addTwo() {\n    cnt += 2;\n    return cnt;\n  }\n\n  const fn = t.mock.fn(addOne, addTwo, { times: 2 });\n\n  assert.strictEqual(fn(), 2);\n  assert.strictEqual(fn(), 4);\n  assert.strictEqual(fn(), 5);\n  assert.strictEqual(fn(), 6);\n});\n</code></pre>"
9371cb0ef41Sopenharmony_ci            },
9381cb0ef41Sopenharmony_ci            {
9391cb0ef41Sopenharmony_ci              "textRaw": "`mock.getter(object, methodName[, implementation][, options])`",
9401cb0ef41Sopenharmony_ci              "type": "method",
9411cb0ef41Sopenharmony_ci              "name": "getter",
9421cb0ef41Sopenharmony_ci              "meta": {
9431cb0ef41Sopenharmony_ci                "added": [
9441cb0ef41Sopenharmony_ci                  "v18.13.0"
9451cb0ef41Sopenharmony_ci                ],
9461cb0ef41Sopenharmony_ci                "changes": []
9471cb0ef41Sopenharmony_ci              },
9481cb0ef41Sopenharmony_ci              "signatures": [
9491cb0ef41Sopenharmony_ci                {
9501cb0ef41Sopenharmony_ci                  "params": []
9511cb0ef41Sopenharmony_ci                }
9521cb0ef41Sopenharmony_ci              ],
9531cb0ef41Sopenharmony_ci              "desc": "<p>This function is syntax sugar for <a href=\"#mockmethodobject-methodname-implementation-options\"><code>MockTracker.method</code></a> with <code>options.getter</code>\nset to <code>true</code>.</p>"
9541cb0ef41Sopenharmony_ci            },
9551cb0ef41Sopenharmony_ci            {
9561cb0ef41Sopenharmony_ci              "textRaw": "`mock.method(object, methodName[, implementation][, options])`",
9571cb0ef41Sopenharmony_ci              "type": "method",
9581cb0ef41Sopenharmony_ci              "name": "method",
9591cb0ef41Sopenharmony_ci              "meta": {
9601cb0ef41Sopenharmony_ci                "added": [
9611cb0ef41Sopenharmony_ci                  "v18.13.0"
9621cb0ef41Sopenharmony_ci                ],
9631cb0ef41Sopenharmony_ci                "changes": []
9641cb0ef41Sopenharmony_ci              },
9651cb0ef41Sopenharmony_ci              "signatures": [
9661cb0ef41Sopenharmony_ci                {
9671cb0ef41Sopenharmony_ci                  "return": {
9681cb0ef41Sopenharmony_ci                    "textRaw": "Returns: {Proxy} The mocked method. The mocked method contains a special `mock` property, which is an instance of [`MockFunctionContext`][], and can be used for inspecting and changing the behavior of the mocked method.",
9691cb0ef41Sopenharmony_ci                    "name": "return",
9701cb0ef41Sopenharmony_ci                    "type": "Proxy",
9711cb0ef41Sopenharmony_ci                    "desc": "The mocked method. The mocked method contains a special `mock` property, which is an instance of [`MockFunctionContext`][], and can be used for inspecting and changing the behavior of the mocked method."
9721cb0ef41Sopenharmony_ci                  },
9731cb0ef41Sopenharmony_ci                  "params": [
9741cb0ef41Sopenharmony_ci                    {
9751cb0ef41Sopenharmony_ci                      "textRaw": "`object` {Object} The object whose method is being mocked.",
9761cb0ef41Sopenharmony_ci                      "name": "object",
9771cb0ef41Sopenharmony_ci                      "type": "Object",
9781cb0ef41Sopenharmony_ci                      "desc": "The object whose method is being mocked."
9791cb0ef41Sopenharmony_ci                    },
9801cb0ef41Sopenharmony_ci                    {
9811cb0ef41Sopenharmony_ci                      "textRaw": "`methodName` {string|symbol} The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown.",
9821cb0ef41Sopenharmony_ci                      "name": "methodName",
9831cb0ef41Sopenharmony_ci                      "type": "string|symbol",
9841cb0ef41Sopenharmony_ci                      "desc": "The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown."
9851cb0ef41Sopenharmony_ci                    },
9861cb0ef41Sopenharmony_ci                    {
9871cb0ef41Sopenharmony_ci                      "textRaw": "`implementation` {Function|AsyncFunction} An optional function used as the mock implementation for `object[methodName]`. **Default:** The original method specified by `object[methodName]`.",
9881cb0ef41Sopenharmony_ci                      "name": "implementation",
9891cb0ef41Sopenharmony_ci                      "type": "Function|AsyncFunction",
9901cb0ef41Sopenharmony_ci                      "default": "The original method specified by `object[methodName]`",
9911cb0ef41Sopenharmony_ci                      "desc": "An optional function used as the mock implementation for `object[methodName]`."
9921cb0ef41Sopenharmony_ci                    },
9931cb0ef41Sopenharmony_ci                    {
9941cb0ef41Sopenharmony_ci                      "textRaw": "`options` {Object} Optional configuration options for the mock method. The following properties are supported:",
9951cb0ef41Sopenharmony_ci                      "name": "options",
9961cb0ef41Sopenharmony_ci                      "type": "Object",
9971cb0ef41Sopenharmony_ci                      "desc": "Optional configuration options for the mock method. The following properties are supported:",
9981cb0ef41Sopenharmony_ci                      "options": [
9991cb0ef41Sopenharmony_ci                        {
10001cb0ef41Sopenharmony_ci                          "textRaw": "`getter` {boolean} If `true`, `object[methodName]` is treated as a getter. This option cannot be used with the `setter` option. **Default:** false.",
10011cb0ef41Sopenharmony_ci                          "name": "getter",
10021cb0ef41Sopenharmony_ci                          "type": "boolean",
10031cb0ef41Sopenharmony_ci                          "default": "false",
10041cb0ef41Sopenharmony_ci                          "desc": "If `true`, `object[methodName]` is treated as a getter. This option cannot be used with the `setter` option."
10051cb0ef41Sopenharmony_ci                        },
10061cb0ef41Sopenharmony_ci                        {
10071cb0ef41Sopenharmony_ci                          "textRaw": "`setter` {boolean} If `true`, `object[methodName]` is treated as a setter. This option cannot be used with the `getter` option. **Default:** false.",
10081cb0ef41Sopenharmony_ci                          "name": "setter",
10091cb0ef41Sopenharmony_ci                          "type": "boolean",
10101cb0ef41Sopenharmony_ci                          "default": "false",
10111cb0ef41Sopenharmony_ci                          "desc": "If `true`, `object[methodName]` is treated as a setter. This option cannot be used with the `getter` option."
10121cb0ef41Sopenharmony_ci                        },
10131cb0ef41Sopenharmony_ci                        {
10141cb0ef41Sopenharmony_ci                          "textRaw": "`times` {integer} The number of times that the mock will use the behavior of `implementation`. Once the mocked method has been called `times` times, it will automatically restore the original behavior. This value must be an integer greater than zero. **Default:** `Infinity`.",
10151cb0ef41Sopenharmony_ci                          "name": "times",
10161cb0ef41Sopenharmony_ci                          "type": "integer",
10171cb0ef41Sopenharmony_ci                          "default": "`Infinity`",
10181cb0ef41Sopenharmony_ci                          "desc": "The number of times that the mock will use the behavior of `implementation`. Once the mocked method has been called `times` times, it will automatically restore the original behavior. This value must be an integer greater than zero."
10191cb0ef41Sopenharmony_ci                        }
10201cb0ef41Sopenharmony_ci                      ]
10211cb0ef41Sopenharmony_ci                    }
10221cb0ef41Sopenharmony_ci                  ]
10231cb0ef41Sopenharmony_ci                }
10241cb0ef41Sopenharmony_ci              ],
10251cb0ef41Sopenharmony_ci              "desc": "<p>This function is used to create a mock on an existing object method. The\nfollowing example demonstrates how a mock is created on an existing object\nmethod.</p>\n<pre><code class=\"language-js\">test('spies on an object method', (t) => {\n  const number = {\n    value: 5,\n    subtract(a) {\n      return this.value - a;\n    },\n  };\n\n  t.mock.method(number, 'subtract');\n  assert.strictEqual(number.subtract.mock.calls.length, 0);\n  assert.strictEqual(number.subtract(3), 2);\n  assert.strictEqual(number.subtract.mock.calls.length, 1);\n\n  const call = number.subtract.mock.calls[0];\n\n  assert.deepStrictEqual(call.arguments, [3]);\n  assert.strictEqual(call.result, 2);\n  assert.strictEqual(call.error, undefined);\n  assert.strictEqual(call.target, undefined);\n  assert.strictEqual(call.this, number);\n});\n</code></pre>"
10261cb0ef41Sopenharmony_ci            },
10271cb0ef41Sopenharmony_ci            {
10281cb0ef41Sopenharmony_ci              "textRaw": "`mock.reset()`",
10291cb0ef41Sopenharmony_ci              "type": "method",
10301cb0ef41Sopenharmony_ci              "name": "reset",
10311cb0ef41Sopenharmony_ci              "meta": {
10321cb0ef41Sopenharmony_ci                "added": [
10331cb0ef41Sopenharmony_ci                  "v18.13.0"
10341cb0ef41Sopenharmony_ci                ],
10351cb0ef41Sopenharmony_ci                "changes": []
10361cb0ef41Sopenharmony_ci              },
10371cb0ef41Sopenharmony_ci              "signatures": [
10381cb0ef41Sopenharmony_ci                {
10391cb0ef41Sopenharmony_ci                  "params": []
10401cb0ef41Sopenharmony_ci                }
10411cb0ef41Sopenharmony_ci              ],
10421cb0ef41Sopenharmony_ci              "desc": "<p>This function restores the default behavior of all mocks that were previously\ncreated by this <code>MockTracker</code> and disassociates the mocks from the\n<code>MockTracker</code> instance. Once disassociated, the mocks can still be used, but the\n<code>MockTracker</code> instance can no longer be used to reset their behavior or\notherwise interact with them.</p>\n<p>After each test completes, this function is called on the test context's\n<code>MockTracker</code>. If the global <code>MockTracker</code> is used extensively, calling this\nfunction manually is recommended.</p>"
10431cb0ef41Sopenharmony_ci            },
10441cb0ef41Sopenharmony_ci            {
10451cb0ef41Sopenharmony_ci              "textRaw": "`mock.restoreAll()`",
10461cb0ef41Sopenharmony_ci              "type": "method",
10471cb0ef41Sopenharmony_ci              "name": "restoreAll",
10481cb0ef41Sopenharmony_ci              "meta": {
10491cb0ef41Sopenharmony_ci                "added": [
10501cb0ef41Sopenharmony_ci                  "v18.13.0"
10511cb0ef41Sopenharmony_ci                ],
10521cb0ef41Sopenharmony_ci                "changes": []
10531cb0ef41Sopenharmony_ci              },
10541cb0ef41Sopenharmony_ci              "signatures": [
10551cb0ef41Sopenharmony_ci                {
10561cb0ef41Sopenharmony_ci                  "params": []
10571cb0ef41Sopenharmony_ci                }
10581cb0ef41Sopenharmony_ci              ],
10591cb0ef41Sopenharmony_ci              "desc": "<p>This function restores the default behavior of all mocks that were previously\ncreated by this <code>MockTracker</code>. Unlike <code>mock.reset()</code>, <code>mock.restoreAll()</code> does\nnot disassociate the mocks from the <code>MockTracker</code> instance.</p>"
10601cb0ef41Sopenharmony_ci            },
10611cb0ef41Sopenharmony_ci            {
10621cb0ef41Sopenharmony_ci              "textRaw": "`mock.setter(object, methodName[, implementation][, options])`",
10631cb0ef41Sopenharmony_ci              "type": "method",
10641cb0ef41Sopenharmony_ci              "name": "setter",
10651cb0ef41Sopenharmony_ci              "meta": {
10661cb0ef41Sopenharmony_ci                "added": [
10671cb0ef41Sopenharmony_ci                  "v18.13.0"
10681cb0ef41Sopenharmony_ci                ],
10691cb0ef41Sopenharmony_ci                "changes": []
10701cb0ef41Sopenharmony_ci              },
10711cb0ef41Sopenharmony_ci              "signatures": [
10721cb0ef41Sopenharmony_ci                {
10731cb0ef41Sopenharmony_ci                  "params": []
10741cb0ef41Sopenharmony_ci                }
10751cb0ef41Sopenharmony_ci              ],
10761cb0ef41Sopenharmony_ci              "desc": "<p>This function is syntax sugar for <a href=\"#mockmethodobject-methodname-implementation-options\"><code>MockTracker.method</code></a> with <code>options.setter</code>\nset to <code>true</code>.</p>"
10771cb0ef41Sopenharmony_ci            }
10781cb0ef41Sopenharmony_ci          ]
10791cb0ef41Sopenharmony_ci        },
10801cb0ef41Sopenharmony_ci        {
10811cb0ef41Sopenharmony_ci          "textRaw": "Class: `MockTimers`",
10821cb0ef41Sopenharmony_ci          "type": "class",
10831cb0ef41Sopenharmony_ci          "name": "MockTimers",
10841cb0ef41Sopenharmony_ci          "meta": {
10851cb0ef41Sopenharmony_ci            "added": [
10861cb0ef41Sopenharmony_ci              "v18.19.0"
10871cb0ef41Sopenharmony_ci            ],
10881cb0ef41Sopenharmony_ci            "changes": []
10891cb0ef41Sopenharmony_ci          },
10901cb0ef41Sopenharmony_ci          "stability": 1,
10911cb0ef41Sopenharmony_ci          "stabilityText": "Experimental",
10921cb0ef41Sopenharmony_ci          "desc": "<p>Mocking timers is a technique commonly used in software testing to simulate and\ncontrol the behavior of timers, such as <code>setInterval</code> and <code>setTimeout</code>,\nwithout actually waiting for the specified time intervals.</p>\n<p>The <a href=\"#class-mocktracker\"><code>MockTracker</code></a> provides a top-level <code>timers</code> export\nwhich is a <code>MockTimers</code> instance.</p>",
10931cb0ef41Sopenharmony_ci          "methods": [
10941cb0ef41Sopenharmony_ci            {
10951cb0ef41Sopenharmony_ci              "textRaw": "`timers.enable([timers])`",
10961cb0ef41Sopenharmony_ci              "type": "method",
10971cb0ef41Sopenharmony_ci              "name": "enable",
10981cb0ef41Sopenharmony_ci              "meta": {
10991cb0ef41Sopenharmony_ci                "added": [
11001cb0ef41Sopenharmony_ci                  "v18.19.0"
11011cb0ef41Sopenharmony_ci                ],
11021cb0ef41Sopenharmony_ci                "changes": []
11031cb0ef41Sopenharmony_ci              },
11041cb0ef41Sopenharmony_ci              "signatures": [
11051cb0ef41Sopenharmony_ci                {
11061cb0ef41Sopenharmony_ci                  "params": []
11071cb0ef41Sopenharmony_ci                }
11081cb0ef41Sopenharmony_ci              ],
11091cb0ef41Sopenharmony_ci              "desc": "<p>Enables timer mocking for the specified timers.</p>\n<ul>\n<li><code>timers</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type\">&lt;Array&gt;</a> An optional array containing the timers to mock.\nThe currently supported timer values are <code>'setInterval'</code>, <code>'setTimeout'</code>,\nand <code>'setImmediate'</code>.  If no value is provided, all timers (<code>'setInterval'</code>,\n<code>'clearInterval'</code>, <code>'setTimeout'</code>, <code>'clearTimeout'</code>, <code>'setImmediate'</code>,\nand <code>'clearImmediate'</code>) will be mocked by default.</li>\n</ul>\n<p><strong>Note:</strong> When you enable mocking for a specific timer, its associated\nclear function will also be implicitly mocked.</p>\n<p>Example usage:</p>\n<pre><code class=\"language-mjs\">import { mock } from 'node:test';\nmock.timers.enable(['setInterval']);\n</code></pre>\n<pre><code class=\"language-cjs\">const { mock } = require('node:test');\nmock.timers.enable(['setInterval']);\n</code></pre>\n<p>The above example enables mocking for the <code>setInterval</code> timer and\nimplicitly mocks the <code>clearInterval</code> function. Only the <code>setInterval</code>\nand <code>clearInterval</code> functions from <a href=\"./timers.html\">node:timers</a>,\n<a href=\"./timers.html#timers-promises-api\">node:timers/promises</a>, and\n<code>globalThis</code> will be mocked.</p>\n<p>Alternatively, if you call <code>mock.timers.enable()</code> without any parameters:</p>\n<p>All timers (<code>'setInterval'</code>, <code>'clearInterval'</code>, <code>'setTimeout'</code>, and <code>'clearTimeout'</code>)\nwill be mocked. The <code>setInterval</code>, <code>clearInterval</code>, <code>setTimeout</code>, and <code>clearTimeout</code>\nfunctions from <code>node:timers</code>, <code>node:timers/promises</code>,\nand <code>globalThis</code> will be mocked.</p>"
11101cb0ef41Sopenharmony_ci            },
11111cb0ef41Sopenharmony_ci            {
11121cb0ef41Sopenharmony_ci              "textRaw": "`timers.reset()`",
11131cb0ef41Sopenharmony_ci              "type": "method",
11141cb0ef41Sopenharmony_ci              "name": "reset",
11151cb0ef41Sopenharmony_ci              "meta": {
11161cb0ef41Sopenharmony_ci                "added": [
11171cb0ef41Sopenharmony_ci                  "v18.19.0"
11181cb0ef41Sopenharmony_ci                ],
11191cb0ef41Sopenharmony_ci                "changes": []
11201cb0ef41Sopenharmony_ci              },
11211cb0ef41Sopenharmony_ci              "signatures": [
11221cb0ef41Sopenharmony_ci                {
11231cb0ef41Sopenharmony_ci                  "params": []
11241cb0ef41Sopenharmony_ci                }
11251cb0ef41Sopenharmony_ci              ],
11261cb0ef41Sopenharmony_ci              "desc": "<p>This function restores the default behavior of all mocks that were previously\ncreated by this  <code>MockTimers</code> instance and disassociates the mocks\nfrom the  <code>MockTracker</code> instance.</p>\n<p><strong>Note:</strong> After each test completes, this function is called on\nthe test context's  <code>MockTracker</code>.</p>\n<pre><code class=\"language-mjs\">import { mock } from 'node:test';\nmock.timers.reset();\n</code></pre>\n<pre><code class=\"language-cjs\">const { mock } = require('node:test');\nmock.timers.reset();\n</code></pre>"
11271cb0ef41Sopenharmony_ci            },
11281cb0ef41Sopenharmony_ci            {
11291cb0ef41Sopenharmony_ci              "textRaw": "`timers[Symbol.dispose]()`",
11301cb0ef41Sopenharmony_ci              "type": "method",
11311cb0ef41Sopenharmony_ci              "name": "[Symbol.dispose]",
11321cb0ef41Sopenharmony_ci              "signatures": [
11331cb0ef41Sopenharmony_ci                {
11341cb0ef41Sopenharmony_ci                  "params": []
11351cb0ef41Sopenharmony_ci                }
11361cb0ef41Sopenharmony_ci              ],
11371cb0ef41Sopenharmony_ci              "desc": "<p>Calls <code>timers.reset()</code>.</p>"
11381cb0ef41Sopenharmony_ci            },
11391cb0ef41Sopenharmony_ci            {
11401cb0ef41Sopenharmony_ci              "textRaw": "`timers.tick(milliseconds)`",
11411cb0ef41Sopenharmony_ci              "type": "method",
11421cb0ef41Sopenharmony_ci              "name": "tick",
11431cb0ef41Sopenharmony_ci              "meta": {
11441cb0ef41Sopenharmony_ci                "added": [
11451cb0ef41Sopenharmony_ci                  "v18.19.0"
11461cb0ef41Sopenharmony_ci                ],
11471cb0ef41Sopenharmony_ci                "changes": []
11481cb0ef41Sopenharmony_ci              },
11491cb0ef41Sopenharmony_ci              "signatures": [
11501cb0ef41Sopenharmony_ci                {
11511cb0ef41Sopenharmony_ci                  "params": []
11521cb0ef41Sopenharmony_ci                }
11531cb0ef41Sopenharmony_ci              ],
11541cb0ef41Sopenharmony_ci              "desc": "<p>Advances time for all mocked timers.</p>\n<ul>\n<li><code>milliseconds</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\" class=\"type\">&lt;number&gt;</a> The amount of time, in milliseconds,\nto advance the timers.</li>\n</ul>\n<p><strong>Note:</strong> This diverges from how <code>setTimeout</code> in Node.js behaves and accepts\nonly positive numbers. In Node.js, <code>setTimeout</code> with negative numbers is\nonly supported for web compatibility reasons.</p>\n<p>The following example mocks a <code>setTimeout</code> function and\nby using <code>.tick</code> advances in\ntime triggering all pending timers.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n\n  context.mock.timers.enable(['setTimeout']);\n\n  setTimeout(fn, 9999);\n\n  assert.strictEqual(fn.mock.callCount(), 0);\n\n  // Advance in time\n  context.mock.timers.tick(9999);\n\n  assert.strictEqual(fn.mock.callCount(), 1);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n  context.mock.timers.enable(['setTimeout']);\n\n  setTimeout(fn, 9999);\n  assert.strictEqual(fn.mock.callCount(), 0);\n\n  // Advance in time\n  context.mock.timers.tick(9999);\n\n  assert.strictEqual(fn.mock.callCount(), 1);\n});\n</code></pre>\n<p>Alternativelly, the <code>.tick</code> function can be called many times</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n  context.mock.timers.enable(['setTimeout']);\n  const nineSecs = 9000;\n  setTimeout(fn, nineSecs);\n\n  const twoSeconds = 3000;\n  context.mock.timers.tick(twoSeconds);\n  context.mock.timers.tick(twoSeconds);\n  context.mock.timers.tick(twoSeconds);\n\n  assert.strictEqual(fn.mock.callCount(), 1);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n  context.mock.timers.enable(['setTimeout']);\n  const nineSecs = 9000;\n  setTimeout(fn, nineSecs);\n\n  const twoSeconds = 3000;\n  context.mock.timers.tick(twoSeconds);\n  context.mock.timers.tick(twoSeconds);\n  context.mock.timers.tick(twoSeconds);\n\n  assert.strictEqual(fn.mock.callCount(), 1);\n});\n</code></pre>",
11551cb0ef41Sopenharmony_ci              "modules": [
11561cb0ef41Sopenharmony_ci                {
11571cb0ef41Sopenharmony_ci                  "textRaw": "Using clear functions",
11581cb0ef41Sopenharmony_ci                  "name": "using_clear_functions",
11591cb0ef41Sopenharmony_ci                  "desc": "<p>As mentioned, all clear functions from timers (<code>clearTimeout</code> and <code>clearInterval</code>)\nare implicity mocked. Take a look at this example using <code>setTimeout</code>:</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n\n  // Optionally choose what to mock\n  context.mock.timers.enable(['setTimeout']);\n  const id = setTimeout(fn, 9999);\n\n  // Implicity mocked as well\n  clearTimeout(id);\n  context.mock.timers.tick(9999);\n\n  // As that setTimeout was cleared the mock function will never be called\n  assert.strictEqual(fn.mock.callCount(), 0);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n\n  // Optionally choose what to mock\n  context.mock.timers.enable(['setTimeout']);\n  const id = setTimeout(fn, 9999);\n\n  // Implicity mocked as well\n  clearTimeout(id);\n  context.mock.timers.tick(9999);\n\n  // As that setTimeout was cleared the mock function will never be called\n  assert.strictEqual(fn.mock.callCount(), 0);\n});\n</code></pre>",
11601cb0ef41Sopenharmony_ci                  "type": "module",
11611cb0ef41Sopenharmony_ci                  "displayName": "Using clear functions"
11621cb0ef41Sopenharmony_ci                },
11631cb0ef41Sopenharmony_ci                {
11641cb0ef41Sopenharmony_ci                  "textRaw": "Working with Node.js timers modules",
11651cb0ef41Sopenharmony_ci                  "name": "working_with_node.js_timers_modules",
11661cb0ef41Sopenharmony_ci                  "desc": "<p>Once you enable mocking timers, <a href=\"./timers.html\">node:timers</a>,\n<a href=\"./timers.html#timers-promises-api\">node:timers/promises</a> modules,\nand timers from the Node.js global context are enabled:</p>\n<p><strong>Note:</strong> Destructuring functions such as\n<code>import { setTimeout } from 'node:timers'</code> is currently\nnot supported by this API.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\nimport nodeTimers from 'node:timers';\nimport nodeTimersPromises from 'node:timers/promises';\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', async (context) => {\n  const globalTimeoutObjectSpy = context.mock.fn();\n  const nodeTimerSpy = context.mock.fn();\n  const nodeTimerPromiseSpy = context.mock.fn();\n\n  // Optionally choose what to mock\n  context.mock.timers.enable(['setTimeout']);\n  setTimeout(globalTimeoutObjectSpy, 9999);\n  nodeTimers.setTimeout(nodeTimerSpy, 9999);\n\n  const promise = nodeTimersPromises.setTimeout(9999).then(nodeTimerPromiseSpy);\n\n  // Advance in time\n  context.mock.timers.tick(9999);\n  assert.strictEqual(globalTimeoutObjectSpy.mock.callCount(), 1);\n  assert.strictEqual(nodeTimerSpy.mock.callCount(), 1);\n  await promise;\n  assert.strictEqual(nodeTimerPromiseSpy.mock.callCount(), 1);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\nconst nodeTimers = require('node:timers');\nconst nodeTimersPromises = require('node:timers/promises');\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', async (context) => {\n  const globalTimeoutObjectSpy = context.mock.fn();\n  const nodeTimerSpy = context.mock.fn();\n  const nodeTimerPromiseSpy = context.mock.fn();\n\n  // Optionally choose what to mock\n  context.mock.timers.enable(['setTimeout']);\n  setTimeout(globalTimeoutObjectSpy, 9999);\n  nodeTimers.setTimeout(nodeTimerSpy, 9999);\n\n  const promise = nodeTimersPromises.setTimeout(9999).then(nodeTimerPromiseSpy);\n\n  // Advance in time\n  context.mock.timers.tick(9999);\n  assert.strictEqual(globalTimeoutObjectSpy.mock.callCount(), 1);\n  assert.strictEqual(nodeTimerSpy.mock.callCount(), 1);\n  await promise;\n  assert.strictEqual(nodeTimerPromiseSpy.mock.callCount(), 1);\n});\n</code></pre>\n<p>In Node.js, <code>setInterval</code> from <a href=\"./timers.html#timers-promises-api\">node:timers/promises</a>\nis an <code>AsyncGenerator</code> and is also supported by this API:</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\nimport nodeTimersPromises from 'node:timers/promises';\ntest('should tick five times testing a real use case', async (context) => {\n  context.mock.timers.enable(['setInterval']);\n\n  const expectedIterations = 3;\n  const interval = 1000;\n  const startedAt = Date.now();\n  async function run() {\n    const times = [];\n    for await (const time of nodeTimersPromises.setInterval(interval, startedAt)) {\n      times.push(time);\n      if (times.length === expectedIterations) break;\n    }\n    return times;\n  }\n\n  const r = run();\n  context.mock.timers.tick(interval);\n  context.mock.timers.tick(interval);\n  context.mock.timers.tick(interval);\n\n  const timeResults = await r;\n  assert.strictEqual(timeResults.length, expectedIterations);\n  for (let it = 1; it &#x3C; expectedIterations; it++) {\n    assert.strictEqual(timeResults[it - 1], startedAt + (interval * it));\n  }\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\nconst nodeTimersPromises = require('node:timers/promises');\ntest('should tick five times testing a real use case', async (context) => {\n  context.mock.timers.enable(['setInterval']);\n\n  const expectedIterations = 3;\n  const interval = 1000;\n  const startedAt = Date.now();\n  async function run() {\n    const times = [];\n    for await (const time of nodeTimersPromises.setInterval(interval, startedAt)) {\n      times.push(time);\n      if (times.length === expectedIterations) break;\n    }\n    return times;\n  }\n\n  const r = run();\n  context.mock.timers.tick(interval);\n  context.mock.timers.tick(interval);\n  context.mock.timers.tick(interval);\n\n  const timeResults = await r;\n  assert.strictEqual(timeResults.length, expectedIterations);\n  for (let it = 1; it &#x3C; expectedIterations; it++) {\n    assert.strictEqual(timeResults[it - 1], startedAt + (interval * it));\n  }\n});\n</code></pre>",
11671cb0ef41Sopenharmony_ci                  "type": "module",
11681cb0ef41Sopenharmony_ci                  "displayName": "Working with Node.js timers modules"
11691cb0ef41Sopenharmony_ci                }
11701cb0ef41Sopenharmony_ci              ]
11711cb0ef41Sopenharmony_ci            },
11721cb0ef41Sopenharmony_ci            {
11731cb0ef41Sopenharmony_ci              "textRaw": "`timers.runAll()`",
11741cb0ef41Sopenharmony_ci              "type": "method",
11751cb0ef41Sopenharmony_ci              "name": "runAll",
11761cb0ef41Sopenharmony_ci              "meta": {
11771cb0ef41Sopenharmony_ci                "added": [
11781cb0ef41Sopenharmony_ci                  "v18.19.0"
11791cb0ef41Sopenharmony_ci                ],
11801cb0ef41Sopenharmony_ci                "changes": []
11811cb0ef41Sopenharmony_ci              },
11821cb0ef41Sopenharmony_ci              "signatures": [
11831cb0ef41Sopenharmony_ci                {
11841cb0ef41Sopenharmony_ci                  "params": []
11851cb0ef41Sopenharmony_ci                }
11861cb0ef41Sopenharmony_ci              ],
11871cb0ef41Sopenharmony_ci              "desc": "<p>Triggers all pending mocked timers immediately.</p>\n<p>The example below triggers all pending timers immediately,\ncausing them to execute without any delay.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('runAll functions following the given order', (context) => {\n  context.mock.timers.enable(['setTimeout']);\n  const results = [];\n  setTimeout(() => results.push(1), 9999);\n\n  // Notice that if both timers have the same timeout,\n  // the order of execution is guaranteed\n  setTimeout(() => results.push(3), 8888);\n  setTimeout(() => results.push(2), 8888);\n\n  assert.deepStrictEqual(results, []);\n\n  context.mock.timers.runAll();\n\n  assert.deepStrictEqual(results, [3, 2, 1]);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('runAll functions following the given order', (context) => {\n  context.mock.timers.enable(['setTimeout']);\n  const results = [];\n  setTimeout(() => results.push(1), 9999);\n\n  // Notice that if both timers have the same timeout,\n  // the order of execution is guaranteed\n  setTimeout(() => results.push(3), 8888);\n  setTimeout(() => results.push(2), 8888);\n\n  assert.deepStrictEqual(results, []);\n\n  context.mock.timers.runAll();\n\n  assert.deepStrictEqual(results, [3, 2, 1]);\n});\n</code></pre>\n<p><strong>Note:</strong> The <code>runAll()</code> function is specifically designed for\ntriggering timers in the context of timer mocking.\nIt does not have any effect on real-time system\nclocks or actual timers outside of the mocking environment.</p>"
11881cb0ef41Sopenharmony_ci            }
11891cb0ef41Sopenharmony_ci          ]
11901cb0ef41Sopenharmony_ci        },
11911cb0ef41Sopenharmony_ci        {
11921cb0ef41Sopenharmony_ci          "textRaw": "Class: `TestsStream`",
11931cb0ef41Sopenharmony_ci          "type": "class",
11941cb0ef41Sopenharmony_ci          "name": "TestsStream",
11951cb0ef41Sopenharmony_ci          "meta": {
11961cb0ef41Sopenharmony_ci            "added": [
11971cb0ef41Sopenharmony_ci              "v18.9.0",
11981cb0ef41Sopenharmony_ci              "v16.19.0"
11991cb0ef41Sopenharmony_ci            ],
12001cb0ef41Sopenharmony_ci            "changes": [
12011cb0ef41Sopenharmony_ci              {
12021cb0ef41Sopenharmony_ci                "version": "v18.17.0",
12031cb0ef41Sopenharmony_ci                "pr-url": "https://github.com/nodejs/node/pull/47094",
12041cb0ef41Sopenharmony_ci                "description": "added type to test:pass and test:fail events for when the test is a suite."
12051cb0ef41Sopenharmony_ci              }
12061cb0ef41Sopenharmony_ci            ]
12071cb0ef41Sopenharmony_ci          },
12081cb0ef41Sopenharmony_ci          "desc": "<ul>\n<li>Extends <a href=\"webstreams.html#class-readablestream\" class=\"type\">&lt;ReadableStream&gt;</a></li>\n</ul>\n<p>A successful call to <a href=\"#runoptions\"><code>run()</code></a> method will return a new <a href=\"test.html#class-testsstream\" class=\"type\">&lt;TestsStream&gt;</a>\nobject, streaming a series of events representing the execution of the tests.\n<code>TestsStream</code> will emit events, in the order of the tests definition</p>",
12091cb0ef41Sopenharmony_ci          "events": [
12101cb0ef41Sopenharmony_ci            {
12111cb0ef41Sopenharmony_ci              "textRaw": "Event: `'test:coverage'`",
12121cb0ef41Sopenharmony_ci              "type": "event",
12131cb0ef41Sopenharmony_ci              "name": "test:coverage",
12141cb0ef41Sopenharmony_ci              "params": [
12151cb0ef41Sopenharmony_ci                {
12161cb0ef41Sopenharmony_ci                  "textRaw": "`data` {Object}",
12171cb0ef41Sopenharmony_ci                  "name": "data",
12181cb0ef41Sopenharmony_ci                  "type": "Object",
12191cb0ef41Sopenharmony_ci                  "options": [
12201cb0ef41Sopenharmony_ci                    {
12211cb0ef41Sopenharmony_ci                      "textRaw": "`summary` {Object} An object containing the coverage report.",
12221cb0ef41Sopenharmony_ci                      "name": "summary",
12231cb0ef41Sopenharmony_ci                      "type": "Object",
12241cb0ef41Sopenharmony_ci                      "desc": "An object containing the coverage report.",
12251cb0ef41Sopenharmony_ci                      "options": [
12261cb0ef41Sopenharmony_ci                        {
12271cb0ef41Sopenharmony_ci                          "textRaw": "`files` {Array} An array of coverage reports for individual files. Each report is an object with the following schema:",
12281cb0ef41Sopenharmony_ci                          "name": "files",
12291cb0ef41Sopenharmony_ci                          "type": "Array",
12301cb0ef41Sopenharmony_ci                          "desc": "An array of coverage reports for individual files. Each report is an object with the following schema:",
12311cb0ef41Sopenharmony_ci                          "options": [
12321cb0ef41Sopenharmony_ci                            {
12331cb0ef41Sopenharmony_ci                              "textRaw": "`path` {string} The absolute path of the file.",
12341cb0ef41Sopenharmony_ci                              "name": "path",
12351cb0ef41Sopenharmony_ci                              "type": "string",
12361cb0ef41Sopenharmony_ci                              "desc": "The absolute path of the file."
12371cb0ef41Sopenharmony_ci                            },
12381cb0ef41Sopenharmony_ci                            {
12391cb0ef41Sopenharmony_ci                              "textRaw": "`totalLineCount` {number} The total number of lines.",
12401cb0ef41Sopenharmony_ci                              "name": "totalLineCount",
12411cb0ef41Sopenharmony_ci                              "type": "number",
12421cb0ef41Sopenharmony_ci                              "desc": "The total number of lines."
12431cb0ef41Sopenharmony_ci                            },
12441cb0ef41Sopenharmony_ci                            {
12451cb0ef41Sopenharmony_ci                              "textRaw": "`totalBranchCount` {number} The total number of branches.",
12461cb0ef41Sopenharmony_ci                              "name": "totalBranchCount",
12471cb0ef41Sopenharmony_ci                              "type": "number",
12481cb0ef41Sopenharmony_ci                              "desc": "The total number of branches."
12491cb0ef41Sopenharmony_ci                            },
12501cb0ef41Sopenharmony_ci                            {
12511cb0ef41Sopenharmony_ci                              "textRaw": "`totalFunctionCount` {number} The total number of functions.",
12521cb0ef41Sopenharmony_ci                              "name": "totalFunctionCount",
12531cb0ef41Sopenharmony_ci                              "type": "number",
12541cb0ef41Sopenharmony_ci                              "desc": "The total number of functions."
12551cb0ef41Sopenharmony_ci                            },
12561cb0ef41Sopenharmony_ci                            {
12571cb0ef41Sopenharmony_ci                              "textRaw": "`coveredLineCount` {number} The number of covered lines.",
12581cb0ef41Sopenharmony_ci                              "name": "coveredLineCount",
12591cb0ef41Sopenharmony_ci                              "type": "number",
12601cb0ef41Sopenharmony_ci                              "desc": "The number of covered lines."
12611cb0ef41Sopenharmony_ci                            },
12621cb0ef41Sopenharmony_ci                            {
12631cb0ef41Sopenharmony_ci                              "textRaw": "`coveredBranchCount` {number} The number of covered branches.",
12641cb0ef41Sopenharmony_ci                              "name": "coveredBranchCount",
12651cb0ef41Sopenharmony_ci                              "type": "number",
12661cb0ef41Sopenharmony_ci                              "desc": "The number of covered branches."
12671cb0ef41Sopenharmony_ci                            },
12681cb0ef41Sopenharmony_ci                            {
12691cb0ef41Sopenharmony_ci                              "textRaw": "`coveredFunctionCount` {number} The number of covered functions.",
12701cb0ef41Sopenharmony_ci                              "name": "coveredFunctionCount",
12711cb0ef41Sopenharmony_ci                              "type": "number",
12721cb0ef41Sopenharmony_ci                              "desc": "The number of covered functions."
12731cb0ef41Sopenharmony_ci                            },
12741cb0ef41Sopenharmony_ci                            {
12751cb0ef41Sopenharmony_ci                              "textRaw": "`coveredLinePercent` {number} The percentage of lines covered.",
12761cb0ef41Sopenharmony_ci                              "name": "coveredLinePercent",
12771cb0ef41Sopenharmony_ci                              "type": "number",
12781cb0ef41Sopenharmony_ci                              "desc": "The percentage of lines covered."
12791cb0ef41Sopenharmony_ci                            },
12801cb0ef41Sopenharmony_ci                            {
12811cb0ef41Sopenharmony_ci                              "textRaw": "`coveredBranchPercent` {number} The percentage of branches covered.",
12821cb0ef41Sopenharmony_ci                              "name": "coveredBranchPercent",
12831cb0ef41Sopenharmony_ci                              "type": "number",
12841cb0ef41Sopenharmony_ci                              "desc": "The percentage of branches covered."
12851cb0ef41Sopenharmony_ci                            },
12861cb0ef41Sopenharmony_ci                            {
12871cb0ef41Sopenharmony_ci                              "textRaw": "`coveredFunctionPercent` {number} The percentage of functions covered.",
12881cb0ef41Sopenharmony_ci                              "name": "coveredFunctionPercent",
12891cb0ef41Sopenharmony_ci                              "type": "number",
12901cb0ef41Sopenharmony_ci                              "desc": "The percentage of functions covered."
12911cb0ef41Sopenharmony_ci                            },
12921cb0ef41Sopenharmony_ci                            {
12931cb0ef41Sopenharmony_ci                              "textRaw": "`uncoveredLineNumbers` {Array} An array of integers representing line numbers that are uncovered.",
12941cb0ef41Sopenharmony_ci                              "name": "uncoveredLineNumbers",
12951cb0ef41Sopenharmony_ci                              "type": "Array",
12961cb0ef41Sopenharmony_ci                              "desc": "An array of integers representing line numbers that are uncovered."
12971cb0ef41Sopenharmony_ci                            }
12981cb0ef41Sopenharmony_ci                          ]
12991cb0ef41Sopenharmony_ci                        },
13001cb0ef41Sopenharmony_ci                        {
13011cb0ef41Sopenharmony_ci                          "textRaw": "`totals` {Object} An object containing a summary of coverage for all files.",
13021cb0ef41Sopenharmony_ci                          "name": "totals",
13031cb0ef41Sopenharmony_ci                          "type": "Object",
13041cb0ef41Sopenharmony_ci                          "desc": "An object containing a summary of coverage for all files.",
13051cb0ef41Sopenharmony_ci                          "options": [
13061cb0ef41Sopenharmony_ci                            {
13071cb0ef41Sopenharmony_ci                              "textRaw": "`totalLineCount` {number} The total number of lines.",
13081cb0ef41Sopenharmony_ci                              "name": "totalLineCount",
13091cb0ef41Sopenharmony_ci                              "type": "number",
13101cb0ef41Sopenharmony_ci                              "desc": "The total number of lines."
13111cb0ef41Sopenharmony_ci                            },
13121cb0ef41Sopenharmony_ci                            {
13131cb0ef41Sopenharmony_ci                              "textRaw": "`totalBranchCount` {number} The total number of branches.",
13141cb0ef41Sopenharmony_ci                              "name": "totalBranchCount",
13151cb0ef41Sopenharmony_ci                              "type": "number",
13161cb0ef41Sopenharmony_ci                              "desc": "The total number of branches."
13171cb0ef41Sopenharmony_ci                            },
13181cb0ef41Sopenharmony_ci                            {
13191cb0ef41Sopenharmony_ci                              "textRaw": "`totalFunctionCount` {number} The total number of functions.",
13201cb0ef41Sopenharmony_ci                              "name": "totalFunctionCount",
13211cb0ef41Sopenharmony_ci                              "type": "number",
13221cb0ef41Sopenharmony_ci                              "desc": "The total number of functions."
13231cb0ef41Sopenharmony_ci                            },
13241cb0ef41Sopenharmony_ci                            {
13251cb0ef41Sopenharmony_ci                              "textRaw": "`coveredLineCount` {number} The number of covered lines.",
13261cb0ef41Sopenharmony_ci                              "name": "coveredLineCount",
13271cb0ef41Sopenharmony_ci                              "type": "number",
13281cb0ef41Sopenharmony_ci                              "desc": "The number of covered lines."
13291cb0ef41Sopenharmony_ci                            },
13301cb0ef41Sopenharmony_ci                            {
13311cb0ef41Sopenharmony_ci                              "textRaw": "`coveredBranchCount` {number} The number of covered branches.",
13321cb0ef41Sopenharmony_ci                              "name": "coveredBranchCount",
13331cb0ef41Sopenharmony_ci                              "type": "number",
13341cb0ef41Sopenharmony_ci                              "desc": "The number of covered branches."
13351cb0ef41Sopenharmony_ci                            },
13361cb0ef41Sopenharmony_ci                            {
13371cb0ef41Sopenharmony_ci                              "textRaw": "`coveredFunctionCount` {number} The number of covered functions.",
13381cb0ef41Sopenharmony_ci                              "name": "coveredFunctionCount",
13391cb0ef41Sopenharmony_ci                              "type": "number",
13401cb0ef41Sopenharmony_ci                              "desc": "The number of covered functions."
13411cb0ef41Sopenharmony_ci                            },
13421cb0ef41Sopenharmony_ci                            {
13431cb0ef41Sopenharmony_ci                              "textRaw": "`coveredLinePercent` {number} The percentage of lines covered.",
13441cb0ef41Sopenharmony_ci                              "name": "coveredLinePercent",
13451cb0ef41Sopenharmony_ci                              "type": "number",
13461cb0ef41Sopenharmony_ci                              "desc": "The percentage of lines covered."
13471cb0ef41Sopenharmony_ci                            },
13481cb0ef41Sopenharmony_ci                            {
13491cb0ef41Sopenharmony_ci                              "textRaw": "`coveredBranchPercent` {number} The percentage of branches covered.",
13501cb0ef41Sopenharmony_ci                              "name": "coveredBranchPercent",
13511cb0ef41Sopenharmony_ci                              "type": "number",
13521cb0ef41Sopenharmony_ci                              "desc": "The percentage of branches covered."
13531cb0ef41Sopenharmony_ci                            },
13541cb0ef41Sopenharmony_ci                            {
13551cb0ef41Sopenharmony_ci                              "textRaw": "`coveredFunctionPercent` {number} The percentage of functions covered.",
13561cb0ef41Sopenharmony_ci                              "name": "coveredFunctionPercent",
13571cb0ef41Sopenharmony_ci                              "type": "number",
13581cb0ef41Sopenharmony_ci                              "desc": "The percentage of functions covered."
13591cb0ef41Sopenharmony_ci                            }
13601cb0ef41Sopenharmony_ci                          ]
13611cb0ef41Sopenharmony_ci                        },
13621cb0ef41Sopenharmony_ci                        {
13631cb0ef41Sopenharmony_ci                          "textRaw": "`workingDirectory` {string} The working directory when code coverage began. This is useful for displaying relative path names in case the tests changed the working directory of the Node.js process.",
13641cb0ef41Sopenharmony_ci                          "name": "workingDirectory",
13651cb0ef41Sopenharmony_ci                          "type": "string",
13661cb0ef41Sopenharmony_ci                          "desc": "The working directory when code coverage began. This is useful for displaying relative path names in case the tests changed the working directory of the Node.js process."
13671cb0ef41Sopenharmony_ci                        }
13681cb0ef41Sopenharmony_ci                      ]
13691cb0ef41Sopenharmony_ci                    },
13701cb0ef41Sopenharmony_ci                    {
13711cb0ef41Sopenharmony_ci                      "textRaw": "`nesting` {number} The nesting level of the test.",
13721cb0ef41Sopenharmony_ci                      "name": "nesting",
13731cb0ef41Sopenharmony_ci                      "type": "number",
13741cb0ef41Sopenharmony_ci                      "desc": "The nesting level of the test."
13751cb0ef41Sopenharmony_ci                    }
13761cb0ef41Sopenharmony_ci                  ]
13771cb0ef41Sopenharmony_ci                }
13781cb0ef41Sopenharmony_ci              ],
13791cb0ef41Sopenharmony_ci              "desc": "<p>Emitted when code coverage is enabled and all tests have completed.</p>"
13801cb0ef41Sopenharmony_ci            },
13811cb0ef41Sopenharmony_ci            {
13821cb0ef41Sopenharmony_ci              "textRaw": "Event: `'test:dequeue'`",
13831cb0ef41Sopenharmony_ci              "type": "event",
13841cb0ef41Sopenharmony_ci              "name": "test:dequeue",
13851cb0ef41Sopenharmony_ci              "params": [
13861cb0ef41Sopenharmony_ci                {
13871cb0ef41Sopenharmony_ci                  "textRaw": "`data` {Object}",
13881cb0ef41Sopenharmony_ci                  "name": "data",
13891cb0ef41Sopenharmony_ci                  "type": "Object",
13901cb0ef41Sopenharmony_ci                  "options": [
13911cb0ef41Sopenharmony_ci                    {
13921cb0ef41Sopenharmony_ci                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
13931cb0ef41Sopenharmony_ci                      "name": "column",
13941cb0ef41Sopenharmony_ci                      "type": "number|undefined",
13951cb0ef41Sopenharmony_ci                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
13961cb0ef41Sopenharmony_ci                    },
13971cb0ef41Sopenharmony_ci                    {
13981cb0ef41Sopenharmony_ci                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
13991cb0ef41Sopenharmony_ci                      "name": "file",
14001cb0ef41Sopenharmony_ci                      "type": "string|undefined",
14011cb0ef41Sopenharmony_ci                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
14021cb0ef41Sopenharmony_ci                    },
14031cb0ef41Sopenharmony_ci                    {
14041cb0ef41Sopenharmony_ci                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
14051cb0ef41Sopenharmony_ci                      "name": "line",
14061cb0ef41Sopenharmony_ci                      "type": "number|undefined",
14071cb0ef41Sopenharmony_ci                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
14081cb0ef41Sopenharmony_ci                    },
14091cb0ef41Sopenharmony_ci                    {
14101cb0ef41Sopenharmony_ci                      "textRaw": "`name` {string} The test name.",
14111cb0ef41Sopenharmony_ci                      "name": "name",
14121cb0ef41Sopenharmony_ci                      "type": "string",
14131cb0ef41Sopenharmony_ci                      "desc": "The test name."
14141cb0ef41Sopenharmony_ci                    },
14151cb0ef41Sopenharmony_ci                    {
14161cb0ef41Sopenharmony_ci                      "textRaw": "`nesting` {number} The nesting level of the test.",
14171cb0ef41Sopenharmony_ci                      "name": "nesting",
14181cb0ef41Sopenharmony_ci                      "type": "number",
14191cb0ef41Sopenharmony_ci                      "desc": "The nesting level of the test."
14201cb0ef41Sopenharmony_ci                    }
14211cb0ef41Sopenharmony_ci                  ]
14221cb0ef41Sopenharmony_ci                }
14231cb0ef41Sopenharmony_ci              ],
14241cb0ef41Sopenharmony_ci              "desc": "<p>Emitted when a test is dequeued, right before it is executed.</p>"
14251cb0ef41Sopenharmony_ci            },
14261cb0ef41Sopenharmony_ci            {
14271cb0ef41Sopenharmony_ci              "textRaw": "Event: `'test:diagnostic'`",
14281cb0ef41Sopenharmony_ci              "type": "event",
14291cb0ef41Sopenharmony_ci              "name": "test:diagnostic",
14301cb0ef41Sopenharmony_ci              "params": [
14311cb0ef41Sopenharmony_ci                {
14321cb0ef41Sopenharmony_ci                  "textRaw": "`data` {Object}",
14331cb0ef41Sopenharmony_ci                  "name": "data",
14341cb0ef41Sopenharmony_ci                  "type": "Object",
14351cb0ef41Sopenharmony_ci                  "options": [
14361cb0ef41Sopenharmony_ci                    {
14371cb0ef41Sopenharmony_ci                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
14381cb0ef41Sopenharmony_ci                      "name": "column",
14391cb0ef41Sopenharmony_ci                      "type": "number|undefined",
14401cb0ef41Sopenharmony_ci                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
14411cb0ef41Sopenharmony_ci                    },
14421cb0ef41Sopenharmony_ci                    {
14431cb0ef41Sopenharmony_ci                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
14441cb0ef41Sopenharmony_ci                      "name": "file",
14451cb0ef41Sopenharmony_ci                      "type": "string|undefined",
14461cb0ef41Sopenharmony_ci                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
14471cb0ef41Sopenharmony_ci                    },
14481cb0ef41Sopenharmony_ci                    {
14491cb0ef41Sopenharmony_ci                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
14501cb0ef41Sopenharmony_ci                      "name": "line",
14511cb0ef41Sopenharmony_ci                      "type": "number|undefined",
14521cb0ef41Sopenharmony_ci                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
14531cb0ef41Sopenharmony_ci                    },
14541cb0ef41Sopenharmony_ci                    {
14551cb0ef41Sopenharmony_ci                      "textRaw": "`message` {string} The diagnostic message.",
14561cb0ef41Sopenharmony_ci                      "name": "message",
14571cb0ef41Sopenharmony_ci                      "type": "string",
14581cb0ef41Sopenharmony_ci                      "desc": "The diagnostic message."
14591cb0ef41Sopenharmony_ci                    },
14601cb0ef41Sopenharmony_ci                    {
14611cb0ef41Sopenharmony_ci                      "textRaw": "`nesting` {number} The nesting level of the test.",
14621cb0ef41Sopenharmony_ci                      "name": "nesting",
14631cb0ef41Sopenharmony_ci                      "type": "number",
14641cb0ef41Sopenharmony_ci                      "desc": "The nesting level of the test."
14651cb0ef41Sopenharmony_ci                    }
14661cb0ef41Sopenharmony_ci                  ]
14671cb0ef41Sopenharmony_ci                }
14681cb0ef41Sopenharmony_ci              ],
14691cb0ef41Sopenharmony_ci              "desc": "<p>Emitted when <a href=\"#contextdiagnosticmessage\"><code>context.diagnostic</code></a> is called.</p>"
14701cb0ef41Sopenharmony_ci            },
14711cb0ef41Sopenharmony_ci            {
14721cb0ef41Sopenharmony_ci              "textRaw": "Event: `'test:enqueue'`",
14731cb0ef41Sopenharmony_ci              "type": "event",
14741cb0ef41Sopenharmony_ci              "name": "test:enqueue",
14751cb0ef41Sopenharmony_ci              "params": [
14761cb0ef41Sopenharmony_ci                {
14771cb0ef41Sopenharmony_ci                  "textRaw": "`data` {Object}",
14781cb0ef41Sopenharmony_ci                  "name": "data",
14791cb0ef41Sopenharmony_ci                  "type": "Object",
14801cb0ef41Sopenharmony_ci                  "options": [
14811cb0ef41Sopenharmony_ci                    {
14821cb0ef41Sopenharmony_ci                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
14831cb0ef41Sopenharmony_ci                      "name": "column",
14841cb0ef41Sopenharmony_ci                      "type": "number|undefined",
14851cb0ef41Sopenharmony_ci                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
14861cb0ef41Sopenharmony_ci                    },
14871cb0ef41Sopenharmony_ci                    {
14881cb0ef41Sopenharmony_ci                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
14891cb0ef41Sopenharmony_ci                      "name": "file",
14901cb0ef41Sopenharmony_ci                      "type": "string|undefined",
14911cb0ef41Sopenharmony_ci                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
14921cb0ef41Sopenharmony_ci                    },
14931cb0ef41Sopenharmony_ci                    {
14941cb0ef41Sopenharmony_ci                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
14951cb0ef41Sopenharmony_ci                      "name": "line",
14961cb0ef41Sopenharmony_ci                      "type": "number|undefined",
14971cb0ef41Sopenharmony_ci                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
14981cb0ef41Sopenharmony_ci                    },
14991cb0ef41Sopenharmony_ci                    {
15001cb0ef41Sopenharmony_ci                      "textRaw": "`name` {string} The test name.",
15011cb0ef41Sopenharmony_ci                      "name": "name",
15021cb0ef41Sopenharmony_ci                      "type": "string",
15031cb0ef41Sopenharmony_ci                      "desc": "The test name."
15041cb0ef41Sopenharmony_ci                    },
15051cb0ef41Sopenharmony_ci                    {
15061cb0ef41Sopenharmony_ci                      "textRaw": "`nesting` {number} The nesting level of the test.",
15071cb0ef41Sopenharmony_ci                      "name": "nesting",
15081cb0ef41Sopenharmony_ci                      "type": "number",
15091cb0ef41Sopenharmony_ci                      "desc": "The nesting level of the test."
15101cb0ef41Sopenharmony_ci                    }
15111cb0ef41Sopenharmony_ci                  ]
15121cb0ef41Sopenharmony_ci                }
15131cb0ef41Sopenharmony_ci              ],
15141cb0ef41Sopenharmony_ci              "desc": "<p>Emitted when a test is enqueued for execution.</p>"
15151cb0ef41Sopenharmony_ci            },
15161cb0ef41Sopenharmony_ci            {
15171cb0ef41Sopenharmony_ci              "textRaw": "Event: `'test:fail'`",
15181cb0ef41Sopenharmony_ci              "type": "event",
15191cb0ef41Sopenharmony_ci              "name": "test:fail",
15201cb0ef41Sopenharmony_ci              "params": [
15211cb0ef41Sopenharmony_ci                {
15221cb0ef41Sopenharmony_ci                  "textRaw": "`data` {Object}",
15231cb0ef41Sopenharmony_ci                  "name": "data",
15241cb0ef41Sopenharmony_ci                  "type": "Object",
15251cb0ef41Sopenharmony_ci                  "options": [
15261cb0ef41Sopenharmony_ci                    {
15271cb0ef41Sopenharmony_ci                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
15281cb0ef41Sopenharmony_ci                      "name": "column",
15291cb0ef41Sopenharmony_ci                      "type": "number|undefined",
15301cb0ef41Sopenharmony_ci                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
15311cb0ef41Sopenharmony_ci                    },
15321cb0ef41Sopenharmony_ci                    {
15331cb0ef41Sopenharmony_ci                      "textRaw": "`details` {Object} Additional execution metadata.",
15341cb0ef41Sopenharmony_ci                      "name": "details",
15351cb0ef41Sopenharmony_ci                      "type": "Object",
15361cb0ef41Sopenharmony_ci                      "desc": "Additional execution metadata.",
15371cb0ef41Sopenharmony_ci                      "options": [
15381cb0ef41Sopenharmony_ci                        {
15391cb0ef41Sopenharmony_ci                          "textRaw": "`duration_ms` {number} The duration of the test in milliseconds.",
15401cb0ef41Sopenharmony_ci                          "name": "duration_ms",
15411cb0ef41Sopenharmony_ci                          "type": "number",
15421cb0ef41Sopenharmony_ci                          "desc": "The duration of the test in milliseconds."
15431cb0ef41Sopenharmony_ci                        },
15441cb0ef41Sopenharmony_ci                        {
15451cb0ef41Sopenharmony_ci                          "textRaw": "`error` {Error} An error wrapping the error thrown by the test.",
15461cb0ef41Sopenharmony_ci                          "name": "error",
15471cb0ef41Sopenharmony_ci                          "type": "Error",
15481cb0ef41Sopenharmony_ci                          "desc": "An error wrapping the error thrown by the test.",
15491cb0ef41Sopenharmony_ci                          "options": [
15501cb0ef41Sopenharmony_ci                            {
15511cb0ef41Sopenharmony_ci                              "textRaw": "`cause` {Error} The actual error thrown by the test.",
15521cb0ef41Sopenharmony_ci                              "name": "cause",
15531cb0ef41Sopenharmony_ci                              "type": "Error",
15541cb0ef41Sopenharmony_ci                              "desc": "The actual error thrown by the test."
15551cb0ef41Sopenharmony_ci                            }
15561cb0ef41Sopenharmony_ci                          ]
15571cb0ef41Sopenharmony_ci                        },
15581cb0ef41Sopenharmony_ci                        {
15591cb0ef41Sopenharmony_ci                          "textRaw": "`type` {string|undefined} The type of the test, used to denote whether this is a suite.",
15601cb0ef41Sopenharmony_ci                          "name": "type",
15611cb0ef41Sopenharmony_ci                          "type": "string|undefined",
15621cb0ef41Sopenharmony_ci                          "desc": "The type of the test, used to denote whether this is a suite."
15631cb0ef41Sopenharmony_ci                        }
15641cb0ef41Sopenharmony_ci                      ]
15651cb0ef41Sopenharmony_ci                    },
15661cb0ef41Sopenharmony_ci                    {
15671cb0ef41Sopenharmony_ci                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
15681cb0ef41Sopenharmony_ci                      "name": "file",
15691cb0ef41Sopenharmony_ci                      "type": "string|undefined",
15701cb0ef41Sopenharmony_ci                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
15711cb0ef41Sopenharmony_ci                    },
15721cb0ef41Sopenharmony_ci                    {
15731cb0ef41Sopenharmony_ci                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
15741cb0ef41Sopenharmony_ci                      "name": "line",
15751cb0ef41Sopenharmony_ci                      "type": "number|undefined",
15761cb0ef41Sopenharmony_ci                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
15771cb0ef41Sopenharmony_ci                    },
15781cb0ef41Sopenharmony_ci                    {
15791cb0ef41Sopenharmony_ci                      "textRaw": "`name` {string} The test name.",
15801cb0ef41Sopenharmony_ci                      "name": "name",
15811cb0ef41Sopenharmony_ci                      "type": "string",
15821cb0ef41Sopenharmony_ci                      "desc": "The test name."
15831cb0ef41Sopenharmony_ci                    },
15841cb0ef41Sopenharmony_ci                    {
15851cb0ef41Sopenharmony_ci                      "textRaw": "`nesting` {number} The nesting level of the test.",
15861cb0ef41Sopenharmony_ci                      "name": "nesting",
15871cb0ef41Sopenharmony_ci                      "type": "number",
15881cb0ef41Sopenharmony_ci                      "desc": "The nesting level of the test."
15891cb0ef41Sopenharmony_ci                    },
15901cb0ef41Sopenharmony_ci                    {
15911cb0ef41Sopenharmony_ci                      "textRaw": "`testNumber` {number} The ordinal number of the test.",
15921cb0ef41Sopenharmony_ci                      "name": "testNumber",
15931cb0ef41Sopenharmony_ci                      "type": "number",
15941cb0ef41Sopenharmony_ci                      "desc": "The ordinal number of the test."
15951cb0ef41Sopenharmony_ci                    },
15961cb0ef41Sopenharmony_ci                    {
15971cb0ef41Sopenharmony_ci                      "textRaw": "`todo` {string|boolean|undefined} Present if [`context.todo`][] is called",
15981cb0ef41Sopenharmony_ci                      "name": "todo",
15991cb0ef41Sopenharmony_ci                      "type": "string|boolean|undefined",
16001cb0ef41Sopenharmony_ci                      "desc": "Present if [`context.todo`][] is called"
16011cb0ef41Sopenharmony_ci                    },
16021cb0ef41Sopenharmony_ci                    {
16031cb0ef41Sopenharmony_ci                      "textRaw": "`skip` {string|boolean|undefined} Present if [`context.skip`][] is called",
16041cb0ef41Sopenharmony_ci                      "name": "skip",
16051cb0ef41Sopenharmony_ci                      "type": "string|boolean|undefined",
16061cb0ef41Sopenharmony_ci                      "desc": "Present if [`context.skip`][] is called"
16071cb0ef41Sopenharmony_ci                    }
16081cb0ef41Sopenharmony_ci                  ]
16091cb0ef41Sopenharmony_ci                }
16101cb0ef41Sopenharmony_ci              ],
16111cb0ef41Sopenharmony_ci              "desc": "<p>Emitted when a test fails.</p>"
16121cb0ef41Sopenharmony_ci            },
16131cb0ef41Sopenharmony_ci            {
16141cb0ef41Sopenharmony_ci              "textRaw": "Event: `'test:pass'`",
16151cb0ef41Sopenharmony_ci              "type": "event",
16161cb0ef41Sopenharmony_ci              "name": "test:pass",
16171cb0ef41Sopenharmony_ci              "params": [
16181cb0ef41Sopenharmony_ci                {
16191cb0ef41Sopenharmony_ci                  "textRaw": "`data` {Object}",
16201cb0ef41Sopenharmony_ci                  "name": "data",
16211cb0ef41Sopenharmony_ci                  "type": "Object",
16221cb0ef41Sopenharmony_ci                  "options": [
16231cb0ef41Sopenharmony_ci                    {
16241cb0ef41Sopenharmony_ci                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
16251cb0ef41Sopenharmony_ci                      "name": "column",
16261cb0ef41Sopenharmony_ci                      "type": "number|undefined",
16271cb0ef41Sopenharmony_ci                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
16281cb0ef41Sopenharmony_ci                    },
16291cb0ef41Sopenharmony_ci                    {
16301cb0ef41Sopenharmony_ci                      "textRaw": "`details` {Object} Additional execution metadata.",
16311cb0ef41Sopenharmony_ci                      "name": "details",
16321cb0ef41Sopenharmony_ci                      "type": "Object",
16331cb0ef41Sopenharmony_ci                      "desc": "Additional execution metadata.",
16341cb0ef41Sopenharmony_ci                      "options": [
16351cb0ef41Sopenharmony_ci                        {
16361cb0ef41Sopenharmony_ci                          "textRaw": "`duration_ms` {number} The duration of the test in milliseconds.",
16371cb0ef41Sopenharmony_ci                          "name": "duration_ms",
16381cb0ef41Sopenharmony_ci                          "type": "number",
16391cb0ef41Sopenharmony_ci                          "desc": "The duration of the test in milliseconds."
16401cb0ef41Sopenharmony_ci                        },
16411cb0ef41Sopenharmony_ci                        {
16421cb0ef41Sopenharmony_ci                          "textRaw": "`type` {string|undefined} The type of the test, used to denote whether this is a suite.",
16431cb0ef41Sopenharmony_ci                          "name": "type",
16441cb0ef41Sopenharmony_ci                          "type": "string|undefined",
16451cb0ef41Sopenharmony_ci                          "desc": "The type of the test, used to denote whether this is a suite."
16461cb0ef41Sopenharmony_ci                        }
16471cb0ef41Sopenharmony_ci                      ]
16481cb0ef41Sopenharmony_ci                    },
16491cb0ef41Sopenharmony_ci                    {
16501cb0ef41Sopenharmony_ci                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
16511cb0ef41Sopenharmony_ci                      "name": "file",
16521cb0ef41Sopenharmony_ci                      "type": "string|undefined",
16531cb0ef41Sopenharmony_ci                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
16541cb0ef41Sopenharmony_ci                    },
16551cb0ef41Sopenharmony_ci                    {
16561cb0ef41Sopenharmony_ci                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
16571cb0ef41Sopenharmony_ci                      "name": "line",
16581cb0ef41Sopenharmony_ci                      "type": "number|undefined",
16591cb0ef41Sopenharmony_ci                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
16601cb0ef41Sopenharmony_ci                    },
16611cb0ef41Sopenharmony_ci                    {
16621cb0ef41Sopenharmony_ci                      "textRaw": "`name` {string} The test name.",
16631cb0ef41Sopenharmony_ci                      "name": "name",
16641cb0ef41Sopenharmony_ci                      "type": "string",
16651cb0ef41Sopenharmony_ci                      "desc": "The test name."
16661cb0ef41Sopenharmony_ci                    },
16671cb0ef41Sopenharmony_ci                    {
16681cb0ef41Sopenharmony_ci                      "textRaw": "`nesting` {number} The nesting level of the test.",
16691cb0ef41Sopenharmony_ci                      "name": "nesting",
16701cb0ef41Sopenharmony_ci                      "type": "number",
16711cb0ef41Sopenharmony_ci                      "desc": "The nesting level of the test."
16721cb0ef41Sopenharmony_ci                    },
16731cb0ef41Sopenharmony_ci                    {
16741cb0ef41Sopenharmony_ci                      "textRaw": "`testNumber` {number} The ordinal number of the test.",
16751cb0ef41Sopenharmony_ci                      "name": "testNumber",
16761cb0ef41Sopenharmony_ci                      "type": "number",
16771cb0ef41Sopenharmony_ci                      "desc": "The ordinal number of the test."
16781cb0ef41Sopenharmony_ci                    },
16791cb0ef41Sopenharmony_ci                    {
16801cb0ef41Sopenharmony_ci                      "textRaw": "`todo` {string|boolean|undefined} Present if [`context.todo`][] is called",
16811cb0ef41Sopenharmony_ci                      "name": "todo",
16821cb0ef41Sopenharmony_ci                      "type": "string|boolean|undefined",
16831cb0ef41Sopenharmony_ci                      "desc": "Present if [`context.todo`][] is called"
16841cb0ef41Sopenharmony_ci                    },
16851cb0ef41Sopenharmony_ci                    {
16861cb0ef41Sopenharmony_ci                      "textRaw": "`skip` {string|boolean|undefined} Present if [`context.skip`][] is called",
16871cb0ef41Sopenharmony_ci                      "name": "skip",
16881cb0ef41Sopenharmony_ci                      "type": "string|boolean|undefined",
16891cb0ef41Sopenharmony_ci                      "desc": "Present if [`context.skip`][] is called"
16901cb0ef41Sopenharmony_ci                    }
16911cb0ef41Sopenharmony_ci                  ]
16921cb0ef41Sopenharmony_ci                }
16931cb0ef41Sopenharmony_ci              ],
16941cb0ef41Sopenharmony_ci              "desc": "<p>Emitted when a test passes.</p>"
16951cb0ef41Sopenharmony_ci            },
16961cb0ef41Sopenharmony_ci            {
16971cb0ef41Sopenharmony_ci              "textRaw": "Event: `'test:plan'`",
16981cb0ef41Sopenharmony_ci              "type": "event",
16991cb0ef41Sopenharmony_ci              "name": "test:plan",
17001cb0ef41Sopenharmony_ci              "params": [
17011cb0ef41Sopenharmony_ci                {
17021cb0ef41Sopenharmony_ci                  "textRaw": "`data` {Object}",
17031cb0ef41Sopenharmony_ci                  "name": "data",
17041cb0ef41Sopenharmony_ci                  "type": "Object",
17051cb0ef41Sopenharmony_ci                  "options": [
17061cb0ef41Sopenharmony_ci                    {
17071cb0ef41Sopenharmony_ci                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
17081cb0ef41Sopenharmony_ci                      "name": "column",
17091cb0ef41Sopenharmony_ci                      "type": "number|undefined",
17101cb0ef41Sopenharmony_ci                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
17111cb0ef41Sopenharmony_ci                    },
17121cb0ef41Sopenharmony_ci                    {
17131cb0ef41Sopenharmony_ci                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
17141cb0ef41Sopenharmony_ci                      "name": "file",
17151cb0ef41Sopenharmony_ci                      "type": "string|undefined",
17161cb0ef41Sopenharmony_ci                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
17171cb0ef41Sopenharmony_ci                    },
17181cb0ef41Sopenharmony_ci                    {
17191cb0ef41Sopenharmony_ci                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
17201cb0ef41Sopenharmony_ci                      "name": "line",
17211cb0ef41Sopenharmony_ci                      "type": "number|undefined",
17221cb0ef41Sopenharmony_ci                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
17231cb0ef41Sopenharmony_ci                    },
17241cb0ef41Sopenharmony_ci                    {
17251cb0ef41Sopenharmony_ci                      "textRaw": "`nesting` {number} The nesting level of the test.",
17261cb0ef41Sopenharmony_ci                      "name": "nesting",
17271cb0ef41Sopenharmony_ci                      "type": "number",
17281cb0ef41Sopenharmony_ci                      "desc": "The nesting level of the test."
17291cb0ef41Sopenharmony_ci                    },
17301cb0ef41Sopenharmony_ci                    {
17311cb0ef41Sopenharmony_ci                      "textRaw": "`count` {number} The number of subtests that have ran.",
17321cb0ef41Sopenharmony_ci                      "name": "count",
17331cb0ef41Sopenharmony_ci                      "type": "number",
17341cb0ef41Sopenharmony_ci                      "desc": "The number of subtests that have ran."
17351cb0ef41Sopenharmony_ci                    }
17361cb0ef41Sopenharmony_ci                  ]
17371cb0ef41Sopenharmony_ci                }
17381cb0ef41Sopenharmony_ci              ],
17391cb0ef41Sopenharmony_ci              "desc": "<p>Emitted when all subtests have completed for a given test.</p>"
17401cb0ef41Sopenharmony_ci            },
17411cb0ef41Sopenharmony_ci            {
17421cb0ef41Sopenharmony_ci              "textRaw": "Event: `'test:start'`",
17431cb0ef41Sopenharmony_ci              "type": "event",
17441cb0ef41Sopenharmony_ci              "name": "test:start",
17451cb0ef41Sopenharmony_ci              "params": [
17461cb0ef41Sopenharmony_ci                {
17471cb0ef41Sopenharmony_ci                  "textRaw": "`data` {Object}",
17481cb0ef41Sopenharmony_ci                  "name": "data",
17491cb0ef41Sopenharmony_ci                  "type": "Object",
17501cb0ef41Sopenharmony_ci                  "options": [
17511cb0ef41Sopenharmony_ci                    {
17521cb0ef41Sopenharmony_ci                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
17531cb0ef41Sopenharmony_ci                      "name": "column",
17541cb0ef41Sopenharmony_ci                      "type": "number|undefined",
17551cb0ef41Sopenharmony_ci                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
17561cb0ef41Sopenharmony_ci                    },
17571cb0ef41Sopenharmony_ci                    {
17581cb0ef41Sopenharmony_ci                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
17591cb0ef41Sopenharmony_ci                      "name": "file",
17601cb0ef41Sopenharmony_ci                      "type": "string|undefined",
17611cb0ef41Sopenharmony_ci                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
17621cb0ef41Sopenharmony_ci                    },
17631cb0ef41Sopenharmony_ci                    {
17641cb0ef41Sopenharmony_ci                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
17651cb0ef41Sopenharmony_ci                      "name": "line",
17661cb0ef41Sopenharmony_ci                      "type": "number|undefined",
17671cb0ef41Sopenharmony_ci                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
17681cb0ef41Sopenharmony_ci                    },
17691cb0ef41Sopenharmony_ci                    {
17701cb0ef41Sopenharmony_ci                      "textRaw": "`name` {string} The test name.",
17711cb0ef41Sopenharmony_ci                      "name": "name",
17721cb0ef41Sopenharmony_ci                      "type": "string",
17731cb0ef41Sopenharmony_ci                      "desc": "The test name."
17741cb0ef41Sopenharmony_ci                    },
17751cb0ef41Sopenharmony_ci                    {
17761cb0ef41Sopenharmony_ci                      "textRaw": "`nesting` {number} The nesting level of the test.",
17771cb0ef41Sopenharmony_ci                      "name": "nesting",
17781cb0ef41Sopenharmony_ci                      "type": "number",
17791cb0ef41Sopenharmony_ci                      "desc": "The nesting level of the test."
17801cb0ef41Sopenharmony_ci                    }
17811cb0ef41Sopenharmony_ci                  ]
17821cb0ef41Sopenharmony_ci                }
17831cb0ef41Sopenharmony_ci              ],
17841cb0ef41Sopenharmony_ci              "desc": "<p>Emitted when a test starts reporting its own and its subtests status.\nThis event is guaranteed to be emitted in the same order as the tests are\ndefined.</p>"
17851cb0ef41Sopenharmony_ci            },
17861cb0ef41Sopenharmony_ci            {
17871cb0ef41Sopenharmony_ci              "textRaw": "Event: `'test:stderr'`",
17881cb0ef41Sopenharmony_ci              "type": "event",
17891cb0ef41Sopenharmony_ci              "name": "test:stderr",
17901cb0ef41Sopenharmony_ci              "params": [
17911cb0ef41Sopenharmony_ci                {
17921cb0ef41Sopenharmony_ci                  "textRaw": "`data` {Object}",
17931cb0ef41Sopenharmony_ci                  "name": "data",
17941cb0ef41Sopenharmony_ci                  "type": "Object",
17951cb0ef41Sopenharmony_ci                  "options": [
17961cb0ef41Sopenharmony_ci                    {
17971cb0ef41Sopenharmony_ci                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
17981cb0ef41Sopenharmony_ci                      "name": "column",
17991cb0ef41Sopenharmony_ci                      "type": "number|undefined",
18001cb0ef41Sopenharmony_ci                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
18011cb0ef41Sopenharmony_ci                    },
18021cb0ef41Sopenharmony_ci                    {
18031cb0ef41Sopenharmony_ci                      "textRaw": "`file` {string} The path of the test file.",
18041cb0ef41Sopenharmony_ci                      "name": "file",
18051cb0ef41Sopenharmony_ci                      "type": "string",
18061cb0ef41Sopenharmony_ci                      "desc": "The path of the test file."
18071cb0ef41Sopenharmony_ci                    },
18081cb0ef41Sopenharmony_ci                    {
18091cb0ef41Sopenharmony_ci                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
18101cb0ef41Sopenharmony_ci                      "name": "line",
18111cb0ef41Sopenharmony_ci                      "type": "number|undefined",
18121cb0ef41Sopenharmony_ci                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
18131cb0ef41Sopenharmony_ci                    },
18141cb0ef41Sopenharmony_ci                    {
18151cb0ef41Sopenharmony_ci                      "textRaw": "`message` {string} The message written to `stderr`.",
18161cb0ef41Sopenharmony_ci                      "name": "message",
18171cb0ef41Sopenharmony_ci                      "type": "string",
18181cb0ef41Sopenharmony_ci                      "desc": "The message written to `stderr`."
18191cb0ef41Sopenharmony_ci                    }
18201cb0ef41Sopenharmony_ci                  ]
18211cb0ef41Sopenharmony_ci                }
18221cb0ef41Sopenharmony_ci              ],
18231cb0ef41Sopenharmony_ci              "desc": "<p>Emitted when a running test writes to <code>stderr</code>.\nThis event is only emitted if <code>--test</code> flag is passed.</p>"
18241cb0ef41Sopenharmony_ci            },
18251cb0ef41Sopenharmony_ci            {
18261cb0ef41Sopenharmony_ci              "textRaw": "Event: `'test:stdout'`",
18271cb0ef41Sopenharmony_ci              "type": "event",
18281cb0ef41Sopenharmony_ci              "name": "test:stdout",
18291cb0ef41Sopenharmony_ci              "params": [
18301cb0ef41Sopenharmony_ci                {
18311cb0ef41Sopenharmony_ci                  "textRaw": "`data` {Object}",
18321cb0ef41Sopenharmony_ci                  "name": "data",
18331cb0ef41Sopenharmony_ci                  "type": "Object",
18341cb0ef41Sopenharmony_ci                  "options": [
18351cb0ef41Sopenharmony_ci                    {
18361cb0ef41Sopenharmony_ci                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
18371cb0ef41Sopenharmony_ci                      "name": "column",
18381cb0ef41Sopenharmony_ci                      "type": "number|undefined",
18391cb0ef41Sopenharmony_ci                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
18401cb0ef41Sopenharmony_ci                    },
18411cb0ef41Sopenharmony_ci                    {
18421cb0ef41Sopenharmony_ci                      "textRaw": "`file` {string} The path of the test file.",
18431cb0ef41Sopenharmony_ci                      "name": "file",
18441cb0ef41Sopenharmony_ci                      "type": "string",
18451cb0ef41Sopenharmony_ci                      "desc": "The path of the test file."
18461cb0ef41Sopenharmony_ci                    },
18471cb0ef41Sopenharmony_ci                    {
18481cb0ef41Sopenharmony_ci                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
18491cb0ef41Sopenharmony_ci                      "name": "line",
18501cb0ef41Sopenharmony_ci                      "type": "number|undefined",
18511cb0ef41Sopenharmony_ci                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
18521cb0ef41Sopenharmony_ci                    },
18531cb0ef41Sopenharmony_ci                    {
18541cb0ef41Sopenharmony_ci                      "textRaw": "`message` {string} The message written to `stdout`.",
18551cb0ef41Sopenharmony_ci                      "name": "message",
18561cb0ef41Sopenharmony_ci                      "type": "string",
18571cb0ef41Sopenharmony_ci                      "desc": "The message written to `stdout`."
18581cb0ef41Sopenharmony_ci                    }
18591cb0ef41Sopenharmony_ci                  ]
18601cb0ef41Sopenharmony_ci                }
18611cb0ef41Sopenharmony_ci              ],
18621cb0ef41Sopenharmony_ci              "desc": "<p>Emitted when a running test writes to <code>stdout</code>.\nThis event is only emitted if <code>--test</code> flag is passed.</p>"
18631cb0ef41Sopenharmony_ci            },
18641cb0ef41Sopenharmony_ci            {
18651cb0ef41Sopenharmony_ci              "textRaw": "Event: `'test:watch:drained'`",
18661cb0ef41Sopenharmony_ci              "type": "event",
18671cb0ef41Sopenharmony_ci              "name": "test:watch:drained",
18681cb0ef41Sopenharmony_ci              "params": [],
18691cb0ef41Sopenharmony_ci              "desc": "<p>Emitted when no more tests are queued for execution in watch mode.</p>"
18701cb0ef41Sopenharmony_ci            }
18711cb0ef41Sopenharmony_ci          ]
18721cb0ef41Sopenharmony_ci        },
18731cb0ef41Sopenharmony_ci        {
18741cb0ef41Sopenharmony_ci          "textRaw": "Class: `TestContext`",
18751cb0ef41Sopenharmony_ci          "type": "class",
18761cb0ef41Sopenharmony_ci          "name": "TestContext",
18771cb0ef41Sopenharmony_ci          "meta": {
18781cb0ef41Sopenharmony_ci            "added": [
18791cb0ef41Sopenharmony_ci              "v18.0.0"
18801cb0ef41Sopenharmony_ci            ],
18811cb0ef41Sopenharmony_ci            "changes": [
18821cb0ef41Sopenharmony_ci              {
18831cb0ef41Sopenharmony_ci                "version": "v18.17.0",
18841cb0ef41Sopenharmony_ci                "pr-url": "https://github.com/nodejs/node/pull/47586",
18851cb0ef41Sopenharmony_ci                "description": "The `before` function was added to TestContext."
18861cb0ef41Sopenharmony_ci              }
18871cb0ef41Sopenharmony_ci            ]
18881cb0ef41Sopenharmony_ci          },
18891cb0ef41Sopenharmony_ci          "desc": "<p>An instance of <code>TestContext</code> is passed to each test function in order to\ninteract with the test runner. However, the <code>TestContext</code> constructor is not\nexposed as part of the API.</p>",
18901cb0ef41Sopenharmony_ci          "methods": [
18911cb0ef41Sopenharmony_ci            {
18921cb0ef41Sopenharmony_ci              "textRaw": "`context.before([fn][, options])`",
18931cb0ef41Sopenharmony_ci              "type": "method",
18941cb0ef41Sopenharmony_ci              "name": "before",
18951cb0ef41Sopenharmony_ci              "meta": {
18961cb0ef41Sopenharmony_ci                "added": [
18971cb0ef41Sopenharmony_ci                  "v18.17.0"
18981cb0ef41Sopenharmony_ci                ],
18991cb0ef41Sopenharmony_ci                "changes": []
19001cb0ef41Sopenharmony_ci              },
19011cb0ef41Sopenharmony_ci              "signatures": [
19021cb0ef41Sopenharmony_ci                {
19031cb0ef41Sopenharmony_ci                  "params": [
19041cb0ef41Sopenharmony_ci                    {
19051cb0ef41Sopenharmony_ci                      "textRaw": "`fn` {Function|AsyncFunction} The hook function. The first argument to this function is a [`TestContext`][] object. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
19061cb0ef41Sopenharmony_ci                      "name": "fn",
19071cb0ef41Sopenharmony_ci                      "type": "Function|AsyncFunction",
19081cb0ef41Sopenharmony_ci                      "default": "A no-op function",
19091cb0ef41Sopenharmony_ci                      "desc": "The hook function. The first argument to this function is a [`TestContext`][] object. If the hook uses callbacks, the callback function is passed as the second argument."
19101cb0ef41Sopenharmony_ci                    },
19111cb0ef41Sopenharmony_ci                    {
19121cb0ef41Sopenharmony_ci                      "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
19131cb0ef41Sopenharmony_ci                      "name": "options",
19141cb0ef41Sopenharmony_ci                      "type": "Object",
19151cb0ef41Sopenharmony_ci                      "desc": "Configuration options for the hook. The following properties are supported:",
19161cb0ef41Sopenharmony_ci                      "options": [
19171cb0ef41Sopenharmony_ci                        {
19181cb0ef41Sopenharmony_ci                          "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
19191cb0ef41Sopenharmony_ci                          "name": "signal",
19201cb0ef41Sopenharmony_ci                          "type": "AbortSignal",
19211cb0ef41Sopenharmony_ci                          "desc": "Allows aborting an in-progress hook."
19221cb0ef41Sopenharmony_ci                        },
19231cb0ef41Sopenharmony_ci                        {
19241cb0ef41Sopenharmony_ci                          "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
19251cb0ef41Sopenharmony_ci                          "name": "timeout",
19261cb0ef41Sopenharmony_ci                          "type": "number",
19271cb0ef41Sopenharmony_ci                          "default": "`Infinity`",
19281cb0ef41Sopenharmony_ci                          "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
19291cb0ef41Sopenharmony_ci                        }
19301cb0ef41Sopenharmony_ci                      ]
19311cb0ef41Sopenharmony_ci                    }
19321cb0ef41Sopenharmony_ci                  ]
19331cb0ef41Sopenharmony_ci                }
19341cb0ef41Sopenharmony_ci              ],
19351cb0ef41Sopenharmony_ci              "desc": "<p>This function is used to create a hook running before\nsubtest of the current test.</p>"
19361cb0ef41Sopenharmony_ci            },
19371cb0ef41Sopenharmony_ci            {
19381cb0ef41Sopenharmony_ci              "textRaw": "`context.beforeEach([fn][, options])`",
19391cb0ef41Sopenharmony_ci              "type": "method",
19401cb0ef41Sopenharmony_ci              "name": "beforeEach",
19411cb0ef41Sopenharmony_ci              "meta": {
19421cb0ef41Sopenharmony_ci                "added": [
19431cb0ef41Sopenharmony_ci                  "v18.8.0"
19441cb0ef41Sopenharmony_ci                ],
19451cb0ef41Sopenharmony_ci                "changes": []
19461cb0ef41Sopenharmony_ci              },
19471cb0ef41Sopenharmony_ci              "signatures": [
19481cb0ef41Sopenharmony_ci                {
19491cb0ef41Sopenharmony_ci                  "params": [
19501cb0ef41Sopenharmony_ci                    {
19511cb0ef41Sopenharmony_ci                      "textRaw": "`fn` {Function|AsyncFunction} The hook function. The first argument to this function is a [`TestContext`][] object. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
19521cb0ef41Sopenharmony_ci                      "name": "fn",
19531cb0ef41Sopenharmony_ci                      "type": "Function|AsyncFunction",
19541cb0ef41Sopenharmony_ci                      "default": "A no-op function",
19551cb0ef41Sopenharmony_ci                      "desc": "The hook function. The first argument to this function is a [`TestContext`][] object. If the hook uses callbacks, the callback function is passed as the second argument."
19561cb0ef41Sopenharmony_ci                    },
19571cb0ef41Sopenharmony_ci                    {
19581cb0ef41Sopenharmony_ci                      "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
19591cb0ef41Sopenharmony_ci                      "name": "options",
19601cb0ef41Sopenharmony_ci                      "type": "Object",
19611cb0ef41Sopenharmony_ci                      "desc": "Configuration options for the hook. The following properties are supported:",
19621cb0ef41Sopenharmony_ci                      "options": [
19631cb0ef41Sopenharmony_ci                        {
19641cb0ef41Sopenharmony_ci                          "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
19651cb0ef41Sopenharmony_ci                          "name": "signal",
19661cb0ef41Sopenharmony_ci                          "type": "AbortSignal",
19671cb0ef41Sopenharmony_ci                          "desc": "Allows aborting an in-progress hook."
19681cb0ef41Sopenharmony_ci                        },
19691cb0ef41Sopenharmony_ci                        {
19701cb0ef41Sopenharmony_ci                          "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
19711cb0ef41Sopenharmony_ci                          "name": "timeout",
19721cb0ef41Sopenharmony_ci                          "type": "number",
19731cb0ef41Sopenharmony_ci                          "default": "`Infinity`",
19741cb0ef41Sopenharmony_ci                          "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
19751cb0ef41Sopenharmony_ci                        }
19761cb0ef41Sopenharmony_ci                      ]
19771cb0ef41Sopenharmony_ci                    }
19781cb0ef41Sopenharmony_ci                  ]
19791cb0ef41Sopenharmony_ci                }
19801cb0ef41Sopenharmony_ci              ],
19811cb0ef41Sopenharmony_ci              "desc": "<p>This function is used to create a hook running\nbefore each subtest of the current test.</p>\n<pre><code class=\"language-js\">test('top level test', async (t) => {\n  t.beforeEach((t) => t.diagnostic(`about to run ${t.name}`));\n  await t.test(\n    'This is a subtest',\n    (t) => {\n      assert.ok('some relevant assertion here');\n    },\n  );\n});\n</code></pre>"
19821cb0ef41Sopenharmony_ci            },
19831cb0ef41Sopenharmony_ci            {
19841cb0ef41Sopenharmony_ci              "textRaw": "`context.after([fn][, options])`",
19851cb0ef41Sopenharmony_ci              "type": "method",
19861cb0ef41Sopenharmony_ci              "name": "after",
19871cb0ef41Sopenharmony_ci              "meta": {
19881cb0ef41Sopenharmony_ci                "added": [
19891cb0ef41Sopenharmony_ci                  "v18.13.0"
19901cb0ef41Sopenharmony_ci                ],
19911cb0ef41Sopenharmony_ci                "changes": []
19921cb0ef41Sopenharmony_ci              },
19931cb0ef41Sopenharmony_ci              "signatures": [
19941cb0ef41Sopenharmony_ci                {
19951cb0ef41Sopenharmony_ci                  "params": [
19961cb0ef41Sopenharmony_ci                    {
19971cb0ef41Sopenharmony_ci                      "textRaw": "`fn` {Function|AsyncFunction} The hook function. The first argument to this function is a [`TestContext`][] object. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
19981cb0ef41Sopenharmony_ci                      "name": "fn",
19991cb0ef41Sopenharmony_ci                      "type": "Function|AsyncFunction",
20001cb0ef41Sopenharmony_ci                      "default": "A no-op function",
20011cb0ef41Sopenharmony_ci                      "desc": "The hook function. The first argument to this function is a [`TestContext`][] object. If the hook uses callbacks, the callback function is passed as the second argument."
20021cb0ef41Sopenharmony_ci                    },
20031cb0ef41Sopenharmony_ci                    {
20041cb0ef41Sopenharmony_ci                      "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
20051cb0ef41Sopenharmony_ci                      "name": "options",
20061cb0ef41Sopenharmony_ci                      "type": "Object",
20071cb0ef41Sopenharmony_ci                      "desc": "Configuration options for the hook. The following properties are supported:",
20081cb0ef41Sopenharmony_ci                      "options": [
20091cb0ef41Sopenharmony_ci                        {
20101cb0ef41Sopenharmony_ci                          "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
20111cb0ef41Sopenharmony_ci                          "name": "signal",
20121cb0ef41Sopenharmony_ci                          "type": "AbortSignal",
20131cb0ef41Sopenharmony_ci                          "desc": "Allows aborting an in-progress hook."
20141cb0ef41Sopenharmony_ci                        },
20151cb0ef41Sopenharmony_ci                        {
20161cb0ef41Sopenharmony_ci                          "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
20171cb0ef41Sopenharmony_ci                          "name": "timeout",
20181cb0ef41Sopenharmony_ci                          "type": "number",
20191cb0ef41Sopenharmony_ci                          "default": "`Infinity`",
20201cb0ef41Sopenharmony_ci                          "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
20211cb0ef41Sopenharmony_ci                        }
20221cb0ef41Sopenharmony_ci                      ]
20231cb0ef41Sopenharmony_ci                    }
20241cb0ef41Sopenharmony_ci                  ]
20251cb0ef41Sopenharmony_ci                }
20261cb0ef41Sopenharmony_ci              ],
20271cb0ef41Sopenharmony_ci              "desc": "<p>This function is used to create a hook that runs after the current test\nfinishes.</p>\n<pre><code class=\"language-js\">test('top level test', async (t) => {\n  t.after((t) => t.diagnostic(`finished running ${t.name}`));\n  assert.ok('some relevant assertion here');\n});\n</code></pre>"
20281cb0ef41Sopenharmony_ci            },
20291cb0ef41Sopenharmony_ci            {
20301cb0ef41Sopenharmony_ci              "textRaw": "`context.afterEach([fn][, options])`",
20311cb0ef41Sopenharmony_ci              "type": "method",
20321cb0ef41Sopenharmony_ci              "name": "afterEach",
20331cb0ef41Sopenharmony_ci              "meta": {
20341cb0ef41Sopenharmony_ci                "added": [
20351cb0ef41Sopenharmony_ci                  "v18.8.0"
20361cb0ef41Sopenharmony_ci                ],
20371cb0ef41Sopenharmony_ci                "changes": []
20381cb0ef41Sopenharmony_ci              },
20391cb0ef41Sopenharmony_ci              "signatures": [
20401cb0ef41Sopenharmony_ci                {
20411cb0ef41Sopenharmony_ci                  "params": [
20421cb0ef41Sopenharmony_ci                    {
20431cb0ef41Sopenharmony_ci                      "textRaw": "`fn` {Function|AsyncFunction} The hook function. The first argument to this function is a [`TestContext`][] object. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
20441cb0ef41Sopenharmony_ci                      "name": "fn",
20451cb0ef41Sopenharmony_ci                      "type": "Function|AsyncFunction",
20461cb0ef41Sopenharmony_ci                      "default": "A no-op function",
20471cb0ef41Sopenharmony_ci                      "desc": "The hook function. The first argument to this function is a [`TestContext`][] object. If the hook uses callbacks, the callback function is passed as the second argument."
20481cb0ef41Sopenharmony_ci                    },
20491cb0ef41Sopenharmony_ci                    {
20501cb0ef41Sopenharmony_ci                      "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
20511cb0ef41Sopenharmony_ci                      "name": "options",
20521cb0ef41Sopenharmony_ci                      "type": "Object",
20531cb0ef41Sopenharmony_ci                      "desc": "Configuration options for the hook. The following properties are supported:",
20541cb0ef41Sopenharmony_ci                      "options": [
20551cb0ef41Sopenharmony_ci                        {
20561cb0ef41Sopenharmony_ci                          "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
20571cb0ef41Sopenharmony_ci                          "name": "signal",
20581cb0ef41Sopenharmony_ci                          "type": "AbortSignal",
20591cb0ef41Sopenharmony_ci                          "desc": "Allows aborting an in-progress hook."
20601cb0ef41Sopenharmony_ci                        },
20611cb0ef41Sopenharmony_ci                        {
20621cb0ef41Sopenharmony_ci                          "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
20631cb0ef41Sopenharmony_ci                          "name": "timeout",
20641cb0ef41Sopenharmony_ci                          "type": "number",
20651cb0ef41Sopenharmony_ci                          "default": "`Infinity`",
20661cb0ef41Sopenharmony_ci                          "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
20671cb0ef41Sopenharmony_ci                        }
20681cb0ef41Sopenharmony_ci                      ]
20691cb0ef41Sopenharmony_ci                    }
20701cb0ef41Sopenharmony_ci                  ]
20711cb0ef41Sopenharmony_ci                }
20721cb0ef41Sopenharmony_ci              ],
20731cb0ef41Sopenharmony_ci              "desc": "<p>This function is used to create a hook running\nafter each subtest of the current test.</p>\n<pre><code class=\"language-js\">test('top level test', async (t) => {\n  t.afterEach((t) => t.diagnostic(`finished running ${t.name}`));\n  await t.test(\n    'This is a subtest',\n    (t) => {\n      assert.ok('some relevant assertion here');\n    },\n  );\n});\n</code></pre>"
20741cb0ef41Sopenharmony_ci            },
20751cb0ef41Sopenharmony_ci            {
20761cb0ef41Sopenharmony_ci              "textRaw": "`context.diagnostic(message)`",
20771cb0ef41Sopenharmony_ci              "type": "method",
20781cb0ef41Sopenharmony_ci              "name": "diagnostic",
20791cb0ef41Sopenharmony_ci              "meta": {
20801cb0ef41Sopenharmony_ci                "added": [
20811cb0ef41Sopenharmony_ci                  "v18.0.0"
20821cb0ef41Sopenharmony_ci                ],
20831cb0ef41Sopenharmony_ci                "changes": []
20841cb0ef41Sopenharmony_ci              },
20851cb0ef41Sopenharmony_ci              "signatures": [
20861cb0ef41Sopenharmony_ci                {
20871cb0ef41Sopenharmony_ci                  "params": [
20881cb0ef41Sopenharmony_ci                    {
20891cb0ef41Sopenharmony_ci                      "textRaw": "`message` {string} Message to be reported.",
20901cb0ef41Sopenharmony_ci                      "name": "message",
20911cb0ef41Sopenharmony_ci                      "type": "string",
20921cb0ef41Sopenharmony_ci                      "desc": "Message to be reported."
20931cb0ef41Sopenharmony_ci                    }
20941cb0ef41Sopenharmony_ci                  ]
20951cb0ef41Sopenharmony_ci                }
20961cb0ef41Sopenharmony_ci              ],
20971cb0ef41Sopenharmony_ci              "desc": "<p>This function is used to write diagnostics to the output. Any diagnostic\ninformation is included at the end of the test's results. This function does\nnot return a value.</p>\n<pre><code class=\"language-js\">test('top level test', (t) => {\n  t.diagnostic('A diagnostic message');\n});\n</code></pre>"
20981cb0ef41Sopenharmony_ci            },
20991cb0ef41Sopenharmony_ci            {
21001cb0ef41Sopenharmony_ci              "textRaw": "`context.runOnly(shouldRunOnlyTests)`",
21011cb0ef41Sopenharmony_ci              "type": "method",
21021cb0ef41Sopenharmony_ci              "name": "runOnly",
21031cb0ef41Sopenharmony_ci              "meta": {
21041cb0ef41Sopenharmony_ci                "added": [
21051cb0ef41Sopenharmony_ci                  "v18.0.0"
21061cb0ef41Sopenharmony_ci                ],
21071cb0ef41Sopenharmony_ci                "changes": []
21081cb0ef41Sopenharmony_ci              },
21091cb0ef41Sopenharmony_ci              "signatures": [
21101cb0ef41Sopenharmony_ci                {
21111cb0ef41Sopenharmony_ci                  "params": [
21121cb0ef41Sopenharmony_ci                    {
21131cb0ef41Sopenharmony_ci                      "textRaw": "`shouldRunOnlyTests` {boolean} Whether or not to run `only` tests.",
21141cb0ef41Sopenharmony_ci                      "name": "shouldRunOnlyTests",
21151cb0ef41Sopenharmony_ci                      "type": "boolean",
21161cb0ef41Sopenharmony_ci                      "desc": "Whether or not to run `only` tests."
21171cb0ef41Sopenharmony_ci                    }
21181cb0ef41Sopenharmony_ci                  ]
21191cb0ef41Sopenharmony_ci                }
21201cb0ef41Sopenharmony_ci              ],
21211cb0ef41Sopenharmony_ci              "desc": "<p>If <code>shouldRunOnlyTests</code> is truthy, the test context will only run tests that\nhave the <code>only</code> option set. Otherwise, all tests are run. If Node.js was not\nstarted with the <a href=\"cli.html#--test-only\"><code>--test-only</code></a> command-line option, this function is a\nno-op.</p>\n<pre><code class=\"language-js\">test('top level test', (t) => {\n  // The test context can be set to run subtests with the 'only' option.\n  t.runOnly(true);\n  return Promise.all([\n    t.test('this subtest is now skipped'),\n    t.test('this subtest is run', { only: true }),\n  ]);\n});\n</code></pre>"
21221cb0ef41Sopenharmony_ci            },
21231cb0ef41Sopenharmony_ci            {
21241cb0ef41Sopenharmony_ci              "textRaw": "`context.skip([message])`",
21251cb0ef41Sopenharmony_ci              "type": "method",
21261cb0ef41Sopenharmony_ci              "name": "skip",
21271cb0ef41Sopenharmony_ci              "meta": {
21281cb0ef41Sopenharmony_ci                "added": [
21291cb0ef41Sopenharmony_ci                  "v18.0.0"
21301cb0ef41Sopenharmony_ci                ],
21311cb0ef41Sopenharmony_ci                "changes": []
21321cb0ef41Sopenharmony_ci              },
21331cb0ef41Sopenharmony_ci              "signatures": [
21341cb0ef41Sopenharmony_ci                {
21351cb0ef41Sopenharmony_ci                  "params": [
21361cb0ef41Sopenharmony_ci                    {
21371cb0ef41Sopenharmony_ci                      "textRaw": "`message` {string} Optional skip message.",
21381cb0ef41Sopenharmony_ci                      "name": "message",
21391cb0ef41Sopenharmony_ci                      "type": "string",
21401cb0ef41Sopenharmony_ci                      "desc": "Optional skip message."
21411cb0ef41Sopenharmony_ci                    }
21421cb0ef41Sopenharmony_ci                  ]
21431cb0ef41Sopenharmony_ci                }
21441cb0ef41Sopenharmony_ci              ],
21451cb0ef41Sopenharmony_ci              "desc": "<p>This function causes the test's output to indicate the test as skipped. If\n<code>message</code> is provided, it is included in the output. Calling <code>skip()</code> does\nnot terminate execution of the test function. This function does not return a\nvalue.</p>\n<pre><code class=\"language-js\">test('top level test', (t) => {\n  // Make sure to return here as well if the test contains additional logic.\n  t.skip('this is skipped');\n});\n</code></pre>"
21461cb0ef41Sopenharmony_ci            },
21471cb0ef41Sopenharmony_ci            {
21481cb0ef41Sopenharmony_ci              "textRaw": "`context.todo([message])`",
21491cb0ef41Sopenharmony_ci              "type": "method",
21501cb0ef41Sopenharmony_ci              "name": "todo",
21511cb0ef41Sopenharmony_ci              "meta": {
21521cb0ef41Sopenharmony_ci                "added": [
21531cb0ef41Sopenharmony_ci                  "v18.0.0"
21541cb0ef41Sopenharmony_ci                ],
21551cb0ef41Sopenharmony_ci                "changes": []
21561cb0ef41Sopenharmony_ci              },
21571cb0ef41Sopenharmony_ci              "signatures": [
21581cb0ef41Sopenharmony_ci                {
21591cb0ef41Sopenharmony_ci                  "params": [
21601cb0ef41Sopenharmony_ci                    {
21611cb0ef41Sopenharmony_ci                      "textRaw": "`message` {string} Optional `TODO` message.",
21621cb0ef41Sopenharmony_ci                      "name": "message",
21631cb0ef41Sopenharmony_ci                      "type": "string",
21641cb0ef41Sopenharmony_ci                      "desc": "Optional `TODO` message."
21651cb0ef41Sopenharmony_ci                    }
21661cb0ef41Sopenharmony_ci                  ]
21671cb0ef41Sopenharmony_ci                }
21681cb0ef41Sopenharmony_ci              ],
21691cb0ef41Sopenharmony_ci              "desc": "<p>This function adds a <code>TODO</code> directive to the test's output. If <code>message</code> is\nprovided, it is included in the output. Calling <code>todo()</code> does not terminate\nexecution of the test function. This function does not return a value.</p>\n<pre><code class=\"language-js\">test('top level test', (t) => {\n  // This test is marked as `TODO`\n  t.todo('this is a todo');\n});\n</code></pre>"
21701cb0ef41Sopenharmony_ci            },
21711cb0ef41Sopenharmony_ci            {
21721cb0ef41Sopenharmony_ci              "textRaw": "`context.test([name][, options][, fn])`",
21731cb0ef41Sopenharmony_ci              "type": "method",
21741cb0ef41Sopenharmony_ci              "name": "test",
21751cb0ef41Sopenharmony_ci              "meta": {
21761cb0ef41Sopenharmony_ci                "added": [
21771cb0ef41Sopenharmony_ci                  "v18.0.0"
21781cb0ef41Sopenharmony_ci                ],
21791cb0ef41Sopenharmony_ci                "changes": [
21801cb0ef41Sopenharmony_ci                  {
21811cb0ef41Sopenharmony_ci                    "version": "v18.8.0",
21821cb0ef41Sopenharmony_ci                    "pr-url": "https://github.com/nodejs/node/pull/43554",
21831cb0ef41Sopenharmony_ci                    "description": "Add a `signal` option."
21841cb0ef41Sopenharmony_ci                  },
21851cb0ef41Sopenharmony_ci                  {
21861cb0ef41Sopenharmony_ci                    "version": "v18.7.0",
21871cb0ef41Sopenharmony_ci                    "pr-url": "https://github.com/nodejs/node/pull/43505",
21881cb0ef41Sopenharmony_ci                    "description": "Add a `timeout` option."
21891cb0ef41Sopenharmony_ci                  }
21901cb0ef41Sopenharmony_ci                ]
21911cb0ef41Sopenharmony_ci              },
21921cb0ef41Sopenharmony_ci              "signatures": [
21931cb0ef41Sopenharmony_ci                {
21941cb0ef41Sopenharmony_ci                  "return": {
21951cb0ef41Sopenharmony_ci                    "textRaw": "Returns: {Promise} Resolved with `undefined` once the test completes.",
21961cb0ef41Sopenharmony_ci                    "name": "return",
21971cb0ef41Sopenharmony_ci                    "type": "Promise",
21981cb0ef41Sopenharmony_ci                    "desc": "Resolved with `undefined` once the test completes."
21991cb0ef41Sopenharmony_ci                  },
22001cb0ef41Sopenharmony_ci                  "params": [
22011cb0ef41Sopenharmony_ci                    {
22021cb0ef41Sopenharmony_ci                      "textRaw": "`name` {string} The name of the subtest, which is displayed when reporting test results. **Default:** The `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name.",
22031cb0ef41Sopenharmony_ci                      "name": "name",
22041cb0ef41Sopenharmony_ci                      "type": "string",
22051cb0ef41Sopenharmony_ci                      "default": "The `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name",
22061cb0ef41Sopenharmony_ci                      "desc": "The name of the subtest, which is displayed when reporting test results."
22071cb0ef41Sopenharmony_ci                    },
22081cb0ef41Sopenharmony_ci                    {
22091cb0ef41Sopenharmony_ci                      "textRaw": "`options` {Object} Configuration options for the subtest. The following properties are supported:",
22101cb0ef41Sopenharmony_ci                      "name": "options",
22111cb0ef41Sopenharmony_ci                      "type": "Object",
22121cb0ef41Sopenharmony_ci                      "desc": "Configuration options for the subtest. The following properties are supported:",
22131cb0ef41Sopenharmony_ci                      "options": [
22141cb0ef41Sopenharmony_ci                        {
22151cb0ef41Sopenharmony_ci                          "textRaw": "`concurrency` {number|boolean|null} If a number is provided, then that many tests would run in parallel within the application thread. If `true`, it would run all subtests in parallel. If `false`, it would only run one test at a time. If unspecified, subtests inherit this value from their parent. **Default:** `null`.",
22161cb0ef41Sopenharmony_ci                          "name": "concurrency",
22171cb0ef41Sopenharmony_ci                          "type": "number|boolean|null",
22181cb0ef41Sopenharmony_ci                          "default": "`null`",
22191cb0ef41Sopenharmony_ci                          "desc": "If a number is provided, then that many tests would run in parallel within the application thread. If `true`, it would run all subtests in parallel. If `false`, it would only run one test at a time. If unspecified, subtests inherit this value from their parent."
22201cb0ef41Sopenharmony_ci                        },
22211cb0ef41Sopenharmony_ci                        {
22221cb0ef41Sopenharmony_ci                          "textRaw": "`only` {boolean} If truthy, and the test context is configured to run `only` tests, then this test will be run. Otherwise, the test is skipped. **Default:** `false`.",
22231cb0ef41Sopenharmony_ci                          "name": "only",
22241cb0ef41Sopenharmony_ci                          "type": "boolean",
22251cb0ef41Sopenharmony_ci                          "default": "`false`",
22261cb0ef41Sopenharmony_ci                          "desc": "If truthy, and the test context is configured to run `only` tests, then this test will be run. Otherwise, the test is skipped."
22271cb0ef41Sopenharmony_ci                        },
22281cb0ef41Sopenharmony_ci                        {
22291cb0ef41Sopenharmony_ci                          "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress test.",
22301cb0ef41Sopenharmony_ci                          "name": "signal",
22311cb0ef41Sopenharmony_ci                          "type": "AbortSignal",
22321cb0ef41Sopenharmony_ci                          "desc": "Allows aborting an in-progress test."
22331cb0ef41Sopenharmony_ci                        },
22341cb0ef41Sopenharmony_ci                        {
22351cb0ef41Sopenharmony_ci                          "textRaw": "`skip` {boolean|string} If truthy, the test is skipped. If a string is provided, that string is displayed in the test results as the reason for skipping the test. **Default:** `false`.",
22361cb0ef41Sopenharmony_ci                          "name": "skip",
22371cb0ef41Sopenharmony_ci                          "type": "boolean|string",
22381cb0ef41Sopenharmony_ci                          "default": "`false`",
22391cb0ef41Sopenharmony_ci                          "desc": "If truthy, the test is skipped. If a string is provided, that string is displayed in the test results as the reason for skipping the test."
22401cb0ef41Sopenharmony_ci                        },
22411cb0ef41Sopenharmony_ci                        {
22421cb0ef41Sopenharmony_ci                          "textRaw": "`todo` {boolean|string} If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in the test results as the reason why the test is `TODO`. **Default:** `false`.",
22431cb0ef41Sopenharmony_ci                          "name": "todo",
22441cb0ef41Sopenharmony_ci                          "type": "boolean|string",
22451cb0ef41Sopenharmony_ci                          "default": "`false`",
22461cb0ef41Sopenharmony_ci                          "desc": "If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in the test results as the reason why the test is `TODO`."
22471cb0ef41Sopenharmony_ci                        },
22481cb0ef41Sopenharmony_ci                        {
22491cb0ef41Sopenharmony_ci                          "textRaw": "`timeout` {number} A number of milliseconds the test will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
22501cb0ef41Sopenharmony_ci                          "name": "timeout",
22511cb0ef41Sopenharmony_ci                          "type": "number",
22521cb0ef41Sopenharmony_ci                          "default": "`Infinity`",
22531cb0ef41Sopenharmony_ci                          "desc": "A number of milliseconds the test will fail after. If unspecified, subtests inherit this value from their parent."
22541cb0ef41Sopenharmony_ci                        }
22551cb0ef41Sopenharmony_ci                      ]
22561cb0ef41Sopenharmony_ci                    },
22571cb0ef41Sopenharmony_ci                    {
22581cb0ef41Sopenharmony_ci                      "textRaw": "`fn` {Function|AsyncFunction} The function under test. The first argument to this function is a [`TestContext`][] object. If the test uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
22591cb0ef41Sopenharmony_ci                      "name": "fn",
22601cb0ef41Sopenharmony_ci                      "type": "Function|AsyncFunction",
22611cb0ef41Sopenharmony_ci                      "default": "A no-op function",
22621cb0ef41Sopenharmony_ci                      "desc": "The function under test. The first argument to this function is a [`TestContext`][] object. If the test uses callbacks, the callback function is passed as the second argument."
22631cb0ef41Sopenharmony_ci                    }
22641cb0ef41Sopenharmony_ci                  ]
22651cb0ef41Sopenharmony_ci                }
22661cb0ef41Sopenharmony_ci              ],
22671cb0ef41Sopenharmony_ci              "desc": "<p>This function is used to create subtests under the current test. This function\nbehaves in the same fashion as the top level <a href=\"#testname-options-fn\"><code>test()</code></a> function.</p>\n<pre><code class=\"language-js\">test('top level test', async (t) => {\n  await t.test(\n    'This is a subtest',\n    { only: false, skip: false, concurrency: 1, todo: false },\n    (t) => {\n      assert.ok('some relevant assertion here');\n    },\n  );\n});\n</code></pre>"
22681cb0ef41Sopenharmony_ci            }
22691cb0ef41Sopenharmony_ci          ],
22701cb0ef41Sopenharmony_ci          "properties": [
22711cb0ef41Sopenharmony_ci            {
22721cb0ef41Sopenharmony_ci              "textRaw": "`context.name`",
22731cb0ef41Sopenharmony_ci              "name": "name",
22741cb0ef41Sopenharmony_ci              "meta": {
22751cb0ef41Sopenharmony_ci                "added": [
22761cb0ef41Sopenharmony_ci                  "v18.8.0"
22771cb0ef41Sopenharmony_ci                ],
22781cb0ef41Sopenharmony_ci                "changes": []
22791cb0ef41Sopenharmony_ci              },
22801cb0ef41Sopenharmony_ci              "desc": "<p>The name of the test.</p>"
22811cb0ef41Sopenharmony_ci            },
22821cb0ef41Sopenharmony_ci            {
22831cb0ef41Sopenharmony_ci              "textRaw": "`signal` {AbortSignal} Can be used to abort test subtasks when the test has been aborted.",
22841cb0ef41Sopenharmony_ci              "type": "AbortSignal",
22851cb0ef41Sopenharmony_ci              "name": "signal",
22861cb0ef41Sopenharmony_ci              "meta": {
22871cb0ef41Sopenharmony_ci                "added": [
22881cb0ef41Sopenharmony_ci                  "v18.7.0"
22891cb0ef41Sopenharmony_ci                ],
22901cb0ef41Sopenharmony_ci                "changes": []
22911cb0ef41Sopenharmony_ci              },
22921cb0ef41Sopenharmony_ci              "desc": "<pre><code class=\"language-js\">test('top level test', async (t) => {\n  await fetch('some/uri', { signal: t.signal });\n});\n</code></pre>",
22931cb0ef41Sopenharmony_ci              "shortDesc": "Can be used to abort test subtasks when the test has been aborted."
22941cb0ef41Sopenharmony_ci            }
22951cb0ef41Sopenharmony_ci          ]
22961cb0ef41Sopenharmony_ci        },
22971cb0ef41Sopenharmony_ci        {
22981cb0ef41Sopenharmony_ci          "textRaw": "Class: `SuiteContext`",
22991cb0ef41Sopenharmony_ci          "type": "class",
23001cb0ef41Sopenharmony_ci          "name": "SuiteContext",
23011cb0ef41Sopenharmony_ci          "meta": {
23021cb0ef41Sopenharmony_ci            "added": [
23031cb0ef41Sopenharmony_ci              "v18.7.0"
23041cb0ef41Sopenharmony_ci            ],
23051cb0ef41Sopenharmony_ci            "changes": []
23061cb0ef41Sopenharmony_ci          },
23071cb0ef41Sopenharmony_ci          "desc": "<p>An instance of <code>SuiteContext</code> is passed to each suite function in order to\ninteract with the test runner. However, the <code>SuiteContext</code> constructor is not\nexposed as part of the API.</p>",
23081cb0ef41Sopenharmony_ci          "properties": [
23091cb0ef41Sopenharmony_ci            {
23101cb0ef41Sopenharmony_ci              "textRaw": "`context.name`",
23111cb0ef41Sopenharmony_ci              "name": "name",
23121cb0ef41Sopenharmony_ci              "meta": {
23131cb0ef41Sopenharmony_ci                "added": [
23141cb0ef41Sopenharmony_ci                  "v18.8.0"
23151cb0ef41Sopenharmony_ci                ],
23161cb0ef41Sopenharmony_ci                "changes": []
23171cb0ef41Sopenharmony_ci              },
23181cb0ef41Sopenharmony_ci              "desc": "<p>The name of the suite.</p>"
23191cb0ef41Sopenharmony_ci            },
23201cb0ef41Sopenharmony_ci            {
23211cb0ef41Sopenharmony_ci              "textRaw": "`signal` {AbortSignal} Can be used to abort test subtasks when the test has been aborted.",
23221cb0ef41Sopenharmony_ci              "type": "AbortSignal",
23231cb0ef41Sopenharmony_ci              "name": "signal",
23241cb0ef41Sopenharmony_ci              "meta": {
23251cb0ef41Sopenharmony_ci                "added": [
23261cb0ef41Sopenharmony_ci                  "v18.7.0"
23271cb0ef41Sopenharmony_ci                ],
23281cb0ef41Sopenharmony_ci                "changes": []
23291cb0ef41Sopenharmony_ci              },
23301cb0ef41Sopenharmony_ci              "shortDesc": "Can be used to abort test subtasks when the test has been aborted."
23311cb0ef41Sopenharmony_ci            }
23321cb0ef41Sopenharmony_ci          ]
23331cb0ef41Sopenharmony_ci        }
23341cb0ef41Sopenharmony_ci      ],
23351cb0ef41Sopenharmony_ci      "type": "module",
23361cb0ef41Sopenharmony_ci      "displayName": "Test runner"
23371cb0ef41Sopenharmony_ci    }
23381cb0ef41Sopenharmony_ci  ]
23391cb0ef41Sopenharmony_ci}