☕️ Classic, reliable, trusted test framework for Node.js and the browser
chore: move callback and object typedefs to a new types.d.ts (#5351)
Josh Goldberg ✨3300d2155a1b
diff --git a/.github/workflows/mocha.yml b/.github/workflows/mocha.ymlindex 7a5b5654..5e51575f 100644--- a/.github/workflows/mocha.yml+++ b/.github/workflows/mocha.yml@@ -99,3 +99,8 @@ jobs:# with:# browsers: 'firefox@latest,chrome@latest,MicrosoftEdge@latest,safari@latest'# npm-script: test-browser++ tsc:+ uses: ./.github/workflows/npm-script.yml+ with:+ npm-script: tscdiff --git a/lib/cli/collect-files.js b/lib/cli/collect-files.jsindex 40d6b588..6821dd37 100644--- a/lib/cli/collect-files.js+++ b/lib/cli/collect-files.js@@ -4,7 +4,7 @@ const path = require('node:path');const pc = require('picocolors');const debug = require('debug')('mocha:cli:run:helpers');const { minimatch } = require('minimatch');-const {NO_FILES_MATCH_PATTERN} = require('../errors').constants;+const {NO_FILES_MATCH_PATTERN} = require('../error-constants').constants;const lookupFiles = require('./lookup-files');const {castArray} = require('../utils');@@ -16,6 +16,11 @@ const {castArray} = require('../utils');* @private*/+/**+ * @typedef {import('../types.d.ts').FileCollectionOptions} FileCollectionOptions+ * @typedef {import('../types.d.ts').FileCollectionResponse} FileCollectionResponse+ */+/*** Smash together an array of test files in the correct order* @param {FileCollectionOptions} [opts] - Options@@ -107,30 +112,3 @@ module.exports = ({unmatchedFiles};};--/**- * An object to configure how Mocha gathers test files- * @private- * @typedef {Object} FileCollectionOptions- * @property {string[]} extension - File extensions to use- * @property {string[]} spec - Files, dirs, globs to run- * @property {string[]} ignore - Files, dirs, globs to ignore- * @property {string[]} file - List of additional files to include- * @property {boolean} recursive - Find files recursively- * @property {boolean} sort - Sort test files- */--/**- * Diagnostic object containing unmatched files- * @typedef {Object} UnmatchedFile -- * @property {string} absolutePath - A list of unmatched files derived from the file arguments passed in.- * @property {string} pattern - A list of unmatched files derived from the file arguments passed in.- *- */--/**- * Response object containing a list of files to test and unmatched files.- * @typedef {Object} FileCollectionResponse- * @property {string[]} files - A list of files to test- * @property {UnmatchedFile[]} unmatchedFiles - A list of unmatched files derived from the file arguments passed in.- */diff --git a/lib/cli/run-helpers.js b/lib/cli/run-helpers.jsindex 1d16c285..607d67b6 100644--- a/lib/cli/run-helpers.js+++ b/lib/cli/run-helpers.js@@ -7,6 +7,13 @@* @private*/+/**+ * @typedef {import('../mocha.js')} Mocha+ * @typedef {import('../types.d.ts').MochaOptions} MochaOptions+ * @typedef {import('../types.d.ts').UnmatchedFile} UnmatchedFile+ * @typedef {import('../runner.js')} Runner+ */+const fs = require('node:fs');const path = require('node:path');const pc = require('picocolors');@@ -137,9 +144,7 @@ const handleUnmatchedFiles = (mocha, unmatchedFiles) => {/*** Collect and load test files, then run mocha instance.* @param {Mocha} mocha - Mocha instance- * @param {Options} [opts] - Command line options- * @param {boolean} [opts.exit] - Whether or not to force-exit after tests are complete- * @param {boolean} [opts.passOnFailingTestSuite] - Whether or not to fail test run if tests were failed+ * @param {MochaOptions} [opts] - Command line options* @param {Object} fileCollectParams - Parameters that control test* file collection. See `lib/cli/collect-files.js`.* @returns {Promise<Runner>}@@ -167,15 +172,15 @@ const singleRun = async (};/**- * Collect files and run tests (using `BufferedRunner`).+ * Collect files and run tests (using `Runner`).** This is `async` for consistency.** @param {Mocha} mocha - Mocha instance- * @param {Options} options - Command line options+ * @param {MochaOptions} options - Command line options* @param {Object} fileCollectParams - Parameters that control test* file collection. See `lib/cli/collect-files.js`.- * @returns {Promise<BufferedRunner>}+ * @returns {Promise<Runner>}* @ignore* @private*/@@ -205,7 +210,7 @@ const parallelRun = async (mocha, options, fileCollectParams) => {* - `parallelRun`: run tests in parallel & exit* - `watchParallelRun`: run tests in parallel, rerunning as files change* @param {Mocha} mocha - Mocha instance- * @param {Options} opts - Command line options+ * @param {MochaOptions} options - Command line options* @private* @returns {Promise<Runner>}*/diff --git a/lib/cli/run-option-metadata.js b/lib/cli/run-option-metadata.jsindex de553ef9..b0f86436 100644--- a/lib/cli/run-option-metadata.js+++ b/lib/cli/run-option-metadata.js@@ -9,7 +9,7 @@/*** Dictionary of yargs option types to list of options having said type- * @type {{string:string[]}}+ * @type {Record<string, string[]>}* @private*/const TYPES = (exports.types = {@@ -67,7 +67,7 @@ const TYPES = (exports.types = {/*** Option aliases keyed by canonical option name.* Arrays used to reduce- * @type {{string:string[]}}+ * @type {Record<string, string[]>}* @private*/exports.aliases = {diff --git a/lib/cli/watch-run.js b/lib/cli/watch-run.jsindex 8efb7a2c..6150ec33 100644--- a/lib/cli/watch-run.js+++ b/lib/cli/watch-run.js@@ -8,6 +8,14 @@ const Context = require('../context');const collectFiles = require('./collect-files');const glob = require('glob');+/**+ * @typedef {import('chokidar').FSWatcher} FSWatcher+ * @typedef {import('../mocha.js')} Mocha+ * @typedef {import('../types.d.ts').BeforeWatchRun} BeforeWatchRun+ * @typedef {import('../types.d.ts').FileCollectionOptions} FileCollectionOptions+ * @typedef {import('../types.d.ts').Rerunner} Rerunner+ */+/*** Exports the `watchRun` function that runs mocha in "watch" mode.* @see module:lib/cli/run-helpers@@ -402,20 +410,3 @@ const blastCache = watcher => {});debug('deleted %d file(s) from the require cache', files.length);};--/**- * Callback to be run before `mocha.run()` is called.- * Optionally, it can return a new `Mocha` instance.- * @callback BeforeWatchRun- * @private- * @param {{mocha: Mocha, watcher: FSWatcher}} options- * @returns {Mocha}- */--/**- * Object containing run control methods- * @typedef {Object} Rerunner- * @private- * @property {Function} run - Calls `mocha.run()`- * @property {Function} scheduleRun - Schedules another call to `run`- */diff --git a/lib/context.js b/lib/context.jsindex 388d3082..247a1c17 100644--- a/lib/context.js+++ b/lib/context.js@@ -1,4 +1,9 @@'use strict';++/**+ * @typedef {import('./runnable.js')} Runnable+ */+/*** @module Context*/diff --git a/lib/error-constants.js b/lib/error-constants.jsnew file mode 100644index 00000000..62e1034d--- /dev/null+++ b/lib/error-constants.js@@ -0,0 +1,123 @@+'use strict';++/**+ * When Mocha throws exceptions (or rejects `Promise`s), it attempts to assign a `code` property to the `Error` object, for easier handling. These are the potential values of `code`.+ * @public+ * @namespace+ * @memberof module:lib/errors+ */+var constants = {+ /**+ * An unrecoverable error.+ * @constant+ * @default+ */+ FATAL: 'ERR_MOCHA_FATAL',++ /**+ * The type of an argument to a function call is invalid+ * @constant+ * @default+ */+ INVALID_ARG_TYPE: 'ERR_MOCHA_INVALID_ARG_TYPE',++ /**+ * The value of an argument to a function call is invalid+ * @constant+ * @default+ */+ INVALID_ARG_VALUE: 'ERR_MOCHA_INVALID_ARG_VALUE',++ /**+ * Something was thrown, but it wasn't an `Error`+ * @constant+ * @default+ */+ INVALID_EXCEPTION: 'ERR_MOCHA_INVALID_EXCEPTION',++ /**+ * An interface (e.g., `Mocha.interfaces`) is unknown or invalid+ * @constant+ * @default+ */+ INVALID_INTERFACE: 'ERR_MOCHA_INVALID_INTERFACE',++ /**+ * A reporter (.e.g, `Mocha.reporters`) is unknown or invalid+ * @constant+ * @default+ */+ INVALID_REPORTER: 'ERR_MOCHA_INVALID_REPORTER',++ /**+ * `done()` was called twice in a `Test` or `Hook` callback+ * @constant+ * @default+ */+ MULTIPLE_DONE: 'ERR_MOCHA_MULTIPLE_DONE',++ /**+ * No files matched the pattern provided by the user+ * @constant+ * @default+ */+ NO_FILES_MATCH_PATTERN: 'ERR_MOCHA_NO_FILES_MATCH_PATTERN',++ /**+ * Known, but unsupported behavior of some kind+ * @constant+ * @default+ */+ UNSUPPORTED: 'ERR_MOCHA_UNSUPPORTED',++ /**+ * Invalid state transition occurring in `Mocha` instance+ * @constant+ * @default+ */+ INSTANCE_ALREADY_RUNNING: 'ERR_MOCHA_INSTANCE_ALREADY_RUNNING',++ /**+ * Invalid state transition occurring in `Mocha` instance+ * @constant+ * @default+ */+ INSTANCE_ALREADY_DISPOSED: 'ERR_MOCHA_INSTANCE_ALREADY_DISPOSED',++ /**+ * Use of `only()` w/ `--forbid-only` results in this error.+ * @constant+ * @default+ */+ FORBIDDEN_EXCLUSIVITY: 'ERR_MOCHA_FORBIDDEN_EXCLUSIVITY',++ /**+ * To be thrown when a user-defined plugin implementation (e.g., `mochaHooks`) is invalid+ * @constant+ * @default+ */+ INVALID_PLUGIN_IMPLEMENTATION: 'ERR_MOCHA_INVALID_PLUGIN_IMPLEMENTATION',++ /**+ * To be thrown when a builtin or third-party plugin definition (the _definition_ of `mochaHooks`) is invalid+ * @constant+ * @default+ */+ INVALID_PLUGIN_DEFINITION: 'ERR_MOCHA_INVALID_PLUGIN_DEFINITION',++ /**+ * When a runnable exceeds its allowed run time.+ * @constant+ * @default+ */+ TIMEOUT: 'ERR_MOCHA_TIMEOUT',++ /**+ * Input file is not able to be parsed+ * @constant+ * @default+ */+ UNPARSABLE_FILE: 'ERR_MOCHA_UNPARSABLE_FILE'+};++module.exports = { constants };diff --git a/lib/errors.js b/lib/errors.jsindex aab9c123..79786c24 100644--- a/lib/errors.js+++ b/lib/errors.js@@ -1,6 +1,14 @@'use strict';+/**+ * @typedef {import('./mocha.js')} Mocha+ * @typedef {import('./runnable.js')} Runnable+ * @typedef {import('./types.d.ts').MochaTimeoutError} MochaTimeoutError+ * @typedef {import('./types.d.ts').PluginDefinition} PluginDefinition+ */+const {format} = require('node:util');+const { constants } = require('./error-constants.js');/*** Contains error codes, factory functions to create throwable error objects,@@ -53,126 +61,6 @@ const warn = msg => {}};-/**- * When Mocha throws exceptions (or rejects `Promise`s), it attempts to assign a `code` property to the `Error` object, for easier handling. These are the potential values of `code`.- * @public- * @namespace- * @memberof module:lib/errors- */-var constants = {- /**- * An unrecoverable error.- * @constant- * @default- */- FATAL: 'ERR_MOCHA_FATAL',-- /**- * The type of an argument to a function call is invalid- * @constant- * @default- */- INVALID_ARG_TYPE: 'ERR_MOCHA_INVALID_ARG_TYPE',-- /**- * The value of an argument to a function call is invalid- * @constant- * @default- */- INVALID_ARG_VALUE: 'ERR_MOCHA_INVALID_ARG_VALUE',-- /**- * Something was thrown, but it wasn't an `Error`- * @constant- * @default- */- INVALID_EXCEPTION: 'ERR_MOCHA_INVALID_EXCEPTION',-- /**- * An interface (e.g., `Mocha.interfaces`) is unknown or invalid- * @constant- * @default- */- INVALID_INTERFACE: 'ERR_MOCHA_INVALID_INTERFACE',-- /**- * A reporter (.e.g, `Mocha.reporters`) is unknown or invalid- * @constant- * @default- */- INVALID_REPORTER: 'ERR_MOCHA_INVALID_REPORTER',-- /**- * `done()` was called twice in a `Test` or `Hook` callback- * @constant- * @default- */- MULTIPLE_DONE: 'ERR_MOCHA_MULTIPLE_DONE',-- /**- * No files matched the pattern provided by the user- * @constant- * @default- */- NO_FILES_MATCH_PATTERN: 'ERR_MOCHA_NO_FILES_MATCH_PATTERN',-- /**- * Known, but unsupported behavior of some kind- * @constant- * @default- */- UNSUPPORTED: 'ERR_MOCHA_UNSUPPORTED',-- /**- * Invalid state transition occurring in `Mocha` instance- * @constant- * @default- */- INSTANCE_ALREADY_RUNNING: 'ERR_MOCHA_INSTANCE_ALREADY_RUNNING',-- /**- * Invalid state transition occurring in `Mocha` instance- * @constant- * @default- */- INSTANCE_ALREADY_DISPOSED: 'ERR_MOCHA_INSTANCE_ALREADY_DISPOSED',-- /**- * Use of `only()` w/ `--forbid-only` results in this error.- * @constant- * @default- */- FORBIDDEN_EXCLUSIVITY: 'ERR_MOCHA_FORBIDDEN_EXCLUSIVITY',-- /**- * To be thrown when a user-defined plugin implementation (e.g., `mochaHooks`) is invalid- * @constant- * @default- */- INVALID_PLUGIN_IMPLEMENTATION: 'ERR_MOCHA_INVALID_PLUGIN_IMPLEMENTATION',-- /**- * To be thrown when a builtin or third-party plugin definition (the _definition_ of `mochaHooks`) is invalid- * @constant- * @default- */- INVALID_PLUGIN_DEFINITION: 'ERR_MOCHA_INVALID_PLUGIN_DEFINITION',-- /**- * When a runnable exceeds its allowed run time.- * @constant- * @default- */- TIMEOUT: 'ERR_MOCHA_TIMEOUT',-- /**- * Input file is not able to be parsed- * @constant- * @default- */- UNPARSABLE_FILE: 'ERR_MOCHA_UNPARSABLE_FILE'-};-/*** A set containing all string values of all Mocha error constants, for use by {@link isMochaError}.* @private@@ -527,7 +415,6 @@ const isMochaError = err =>Boolean(err && typeof err === 'object' && MOCHA_ERRORS.has(err.code));module.exports = {- constants,createFatalError,createForbiddenExclusivityError,createInvalidArgumentTypeError,@@ -551,12 +438,3 @@ module.exports = {isMochaError,warn};--/**- * The error thrown when a Runnable times out- * @memberof module:lib/errors- * @typedef {Error} MochaTimeoutError- * @property {constants.TIMEOUT} code - Error code- * @property {number?} timeout Timeout in ms- * @property {string?} file Filepath, if given- */diff --git a/lib/interfaces/bdd.js b/lib/interfaces/bdd.jsindex 40581617..60b4de4a 100644--- a/lib/interfaces/bdd.js+++ b/lib/interfaces/bdd.js@@ -1,5 +1,9 @@'use strict';+/**+ * @typedef {import('../suite.js')} Suite+ */+var Test = require('../test');var EVENT_FILE_PRE_REQUIRE =require('../suite').constants.EVENT_FILE_PRE_REQUIRE;diff --git a/lib/interfaces/common.js b/lib/interfaces/common.jsindex d6656b8c..1e9f148c 100644--- a/lib/interfaces/common.js+++ b/lib/interfaces/common.js@@ -1,5 +1,10 @@'use strict';+/**+ * @typedef {import('../context.js')} Context+ * @typedef {import('../mocha.js')} Mocha+ */+/**@module interfaces/common*/diff --git a/lib/interfaces/qunit.js b/lib/interfaces/qunit.jsindex 8f5434c2..fc7adaa3 100644--- a/lib/interfaces/qunit.js+++ b/lib/interfaces/qunit.js@@ -1,4 +1,7 @@'use strict';+/**+ * @typedef {import('../suite.js')} Suite+ */var Test = require('../test');var EVENT_FILE_PRE_REQUIRE =diff --git a/lib/interfaces/tdd.js b/lib/interfaces/tdd.jsindex 8b7b1d57..c917c1ca 100644--- a/lib/interfaces/tdd.js+++ b/lib/interfaces/tdd.js@@ -1,5 +1,9 @@'use strict';+/**+ * @typedef {import('../suite.js')} Suite+ */+var Test = require('../test');var EVENT_FILE_PRE_REQUIRE =require('../suite').constants.EVENT_FILE_PRE_REQUIRE;diff --git a/lib/mocha.js b/lib/mocha.jsindex d4365e8f..472e8d03 100644--- a/lib/mocha.js+++ b/lib/mocha.js@@ -25,6 +25,14 @@ const {EVENT_FILE_PRE_REQUIRE, EVENT_FILE_POST_REQUIRE, EVENT_FILE_REQUIRE} =Suite.constants;var debug = require('debug')('mocha:mocha');+/**+ * @typedef {import('./types.d.ts').DoneCB} DoneCB+ * @typedef {import('./types.d.ts').MochaGlobalFixture} MochaGlobalFixture+ * @typedef {import('./types.d.ts').MochaOptions} MochaOptions+ * @typedef {import('./types.d.ts').MochaRootHookObject} MochaRootHookObject+ * @typedef {import('./types.d.ts').Reporter} Reporter+ */+exports = module.exports = Mocha;/**@@ -148,37 +156,7 @@ exports.run = function (...args) {** @public* @class Mocha- * @param {Object} [options] - Settings object.- * @param {boolean} [options.allowUncaught] - Propagate uncaught errors?- * @param {boolean} [options.asyncOnly] - Force `done` callback or promise?- * @param {boolean} [options.bail] - Bail after first test failure?- * @param {boolean} [options.checkLeaks] - Check for global variable leaks?- * @param {boolean} [options.color] - Color TTY output from reporter?- * @param {boolean} [options.delay] - Delay root suite execution?- * @param {boolean} [options.diff] - Show diff on failure?- * @param {boolean} [options.dryRun] - Report tests without running them?- * @param {boolean} [options.passOnFailingTestSuite] - Fail test run if tests were failed?- * @param {boolean} [options.failZero] - Fail test run if zero tests?- * @param {string} [options.fgrep] - Test filter given string.- * @param {boolean} [options.forbidOnly] - Tests marked `only` fail the suite?- * @param {boolean} [options.forbidPending] - Pending tests fail the suite?- * @param {boolean} [options.fullTrace] - Full stacktrace upon failure?- * @param {string[]} [options.global] - Variables expected in global scope.- * @param {RegExp|string} [options.grep] - Test filter given regular expression.- * @param {boolean} [options.inlineDiffs] - Display inline diffs?- * @param {boolean} [options.invert] - Invert test filter matches?- * @param {boolean} [options.noHighlighting] - Disable syntax highlighting?- * @param {string|constructor} [options.reporter] - Reporter name or constructor.- * @param {Object} [options.reporterOption] - Reporter settings object.- * @param {number} [options.retries] - Number of times to retry failed tests.- * @param {number} [options.slow] - Slow threshold value.- * @param {number|string} [options.timeout] - Timeout threshold value.- * @param {string} [options.ui] - Interface name.- * @param {boolean} [options.parallel] - Run jobs in parallel.- * @param {number} [options.jobs] - Max number of worker processes for parallel runs.- * @param {MochaRootHookObject} [options.rootHooks] - Hooks to bootstrap the root suite with.- * @param {string[]} [options.require] - Pathname of `rootHooks` plugin for parallel runs.- * @param {boolean} [options.isWorker] - Should be `true` if `Mocha` process is running in a worker process.+ * @param {MochaOptions} [options] - Settings object.*/function Mocha(options = {}) {options = {...mocharc, ...options};@@ -313,7 +291,7 @@ Mocha.prototype.addFile = function (file) {* @public* @see [CLI option](../#-reporter-name-r-name)* @see [Reporters](../#reporters)- * @param {String|Function} reporterName - Reporter name or constructor.+ * @param {String|Reporter} reporterName - Reporter name or constructor.* @param {Object} [reporterOptions] - Options used to configure the reporter.* @returns {Mocha} this* @chainable@@ -953,14 +931,6 @@ Object.defineProperty(Mocha.prototype, 'version', {writable: false});-/**- * Callback to be invoked when test execution is complete.- *- * @private- * @callback DoneCB- * @param {number} failures - Number of failures that occurred.- */-/*** Runs root suite and invokes `fn()` when complete.*@@ -973,7 +943,7 @@ Object.defineProperty(Mocha.prototype, 'version', {* @see {@link Mocha#unloadFiles}* @see {@link Runner#run}* @param {DoneCB} [fn] - Callback invoked when test execution completed.- * @returns {Runner} runner instance+ * @returns {import("./runner.js")} runner instance* @example** // exit with non-zero status if there were test failures@@ -1283,52 +1253,3 @@ Mocha.prototype.hasGlobalTeardownFixtures =function hasGlobalTeardownFixtures() {return Boolean(this.options.globalTeardown.length);};--/**- * An alternative way to define root hooks that works with parallel runs.- * @typedef {Object} MochaRootHookObject- * @property {Function|Function[]} [beforeAll] - "Before all" hook(s)- * @property {Function|Function[]} [beforeEach] - "Before each" hook(s)- * @property {Function|Function[]} [afterAll] - "After all" hook(s)- * @property {Function|Function[]} [afterEach] - "After each" hook(s)- */--/**- * An function that returns a {@link MochaRootHookObject}, either sync or async.- @callback MochaRootHookFunction- * @returns {MochaRootHookObject|Promise<MochaRootHookObject>}- */--/**- * A function that's invoked _once_ which is either sync or async.- * Can be a "teardown" or "setup". These will all share the same context.- * @callback MochaGlobalFixture- * @returns {void|Promise<void>}- */--/**- * An object making up all necessary parts of a plugin loader and aggregator- * @typedef {Object} PluginDefinition- * @property {string} exportName - Named export to use- * @property {string} [optionName] - Option name for Mocha constructor (use `exportName` if omitted)- * @property {PluginValidator} [validate] - Validator function- * @property {PluginFinalizer} [finalize] - Finalizer/aggregator function- */--/**- * A (sync) function to assert a user-supplied plugin implementation is valid.- *- * Defined in a {@link PluginDefinition}.-- * @callback PluginValidator- * @param {*} value - Value to check- * @this {PluginDefinition}- * @returns {void}- */--/**- * A function to finalize plugins impls of a particular ilk- * @callback PluginFinalizer- * @param {Array<*>} impls - User-supplied implementations- * @returns {Promise<*>|*}- */diff --git a/lib/nodejs/buffered-worker-pool.js b/lib/nodejs/buffered-worker-pool.jsindex fe4abf94..ba9e879c 100644--- a/lib/nodejs/buffered-worker-pool.js+++ b/lib/nodejs/buffered-worker-pool.js@@ -7,6 +7,12 @@'use strict';+/**+ * @typedef {import('workerpool').WorkerPoolOptions} WorkerPoolOptions+ * @typedef {import('../types.d.ts').MochaOptions} MochaOptions+ * @typedef {import('../types.d.ts').SerializedWorkerResult} SerializedWorkerResult+ */+const serializeJavascript = require('serialize-javascript');const workerpool = require('workerpool');const {deserialize} = require('./serializer');@@ -20,7 +26,7 @@ const WORKER_PATH = require.resolve('./worker.js');** This is helpful because we tend to same the same options over and over* over IPC.- * @type {WeakMap<Options,string>}+ * @type {WeakMap<MochaOptions,string>}*/let optionsCache = new WeakMap();@@ -113,7 +119,7 @@ class BufferedWorkerPool {* Handles serialization/deserialization.** @param {string} filepath - Filepath of test- * @param {Options} [options] - Options for Mocha instance+ * @param {MochaOptions} [options] - Options for Mocha instance* @private* @returns {Promise<SerializedWorkerResult>}*/@@ -153,7 +159,7 @@ class BufferedWorkerPool {* Given Mocha options object `opts`, serialize into a format suitable for* transmission over IPC.*- * @param {Options} [opts] - Mocha options+ * @param {MochaOptions} [opts] - Mocha options* @private* @returns {string} Serialized options*/diff --git a/lib/nodejs/parallel-buffered-runner.js b/lib/nodejs/parallel-buffered-runner.jsindex dfe8cfad..5af1e3a1 100644--- a/lib/nodejs/parallel-buffered-runner.js+++ b/lib/nodejs/parallel-buffered-runner.js@@ -6,6 +6,13 @@'use strict';+/**+ * @typedef {import('../types.d.ts').FileRunner} FileRunner+ * @typedef {import('../types.d.ts').RunnerOptions} RunnerOptions+ * @typedef {import('../types.d.ts').SerializedWorkerResult} SerializedWorkerResult+ * @typedef {import('../types.d.ts').SigIntListener} SigIntListener+ */+const Runner = require('../runner');const {EVENT_RUN_BEGIN, EVENT_RUN_END} = Runner.constants;const debug = require('debug')('mocha:parallel:parallel-buffered-runner');@@ -105,7 +112,7 @@ class ParallelBufferedRunner extends Runner {/*** Returns a mapping function to enqueue a file in the worker pool and return results of its execution.* @param {BufferedWorkerPool} pool - Worker pool- * @param {Options} options - Mocha options+ * @param {RunnerOptions} options - Mocha options* @returns {FileRunner} Mapping function* @private*/@@ -270,9 +277,7 @@ class ParallelBufferedRunner extends Runner {** @param {Function} callback - Called with an exit code corresponding to* number of test failures.- * @param {Object} [opts] - options- * @param {string[]} opts.files - Files to run- * @param {Options} opts.options - command-line options+ * @param {RunnerOptions} [opts] - options*/run(callback, {files, options = {}} = {}) {/**@@ -416,18 +421,3 @@ class ParallelBufferedRunner extends Runner {}module.exports = ParallelBufferedRunner;--/**- * Listener function intended to be bound to `Process.SIGINT` event- * @private- * @callback SigIntListener- * @returns {Promise<void>}- */--/**- * A function accepting a test file path and returning the results of a test run- * @private- * @callback FileRunner- * @param {string} filename - File to run- * @returns {Promise<SerializedWorkerResult>}- */diff --git a/lib/nodejs/reporters/parallel-buffered.js b/lib/nodejs/reporters/parallel-buffered.jsindex b697312e..272ce29d 100644--- a/lib/nodejs/reporters/parallel-buffered.js+++ b/lib/nodejs/reporters/parallel-buffered.js@@ -6,6 +6,11 @@'use strict';+/**+ * @typedef {import('../../types.d.ts').BufferedEvent} BufferedEvent+ * @typedef {import('../../runner.js')} Runner+ */+/*** Module dependencies.*/@@ -153,13 +158,4 @@ class ParallelBuffered extends Base {}}-/**- * Serializable event data from a `Runner`. Keys of the `data` property- * beginning with `__` will be converted into a function which returns the value- * upon deserialization.- * @typedef {Object} BufferedEvent- * @property {string} name - Event name- * @property {object} data - Event parameters- */-module.exports = ParallelBuffered;diff --git a/lib/nodejs/serializer.js b/lib/nodejs/serializer.jsindex a8ed8dfb..b9f5a12d 100644--- a/lib/nodejs/serializer.js+++ b/lib/nodejs/serializer.js@@ -6,6 +6,11 @@'use strict';+/**+ * @typedef {import('../types.d.ts').SerializedEvent} SerializedEvent+ * @typedef {import('../types.d.ts').SerializedWorkerResult} SerializedWorkerResult+ */+const {type, breakCircularDeps} = require('../utils');const {createInvalidArgumentTypeError} = require('../errors');// this is not named `mocha:parallel:serializer` because it's noisy and it's@@ -393,22 +398,3 @@ exports.deserialize = function deserialize(value) {exports.SerializableEvent = SerializableEvent;exports.SerializableWorkerResult = SerializableWorkerResult;--/**- * The result of calling `SerializableEvent.serialize`, as received- * by the deserializer.- * @private- * @typedef {Object} SerializedEvent- * @property {object?} data - Optional serialized data- * @property {object?} error - Optional serialized `Error`- */--/**- * The result of calling `SerializableWorkerResult.serialize` as received- * by the deserializer.- * @private- * @typedef {Object} SerializedWorkerResult- * @property {number} failureCount - Number of failures- * @property {SerializedEvent[]} events - Serialized events- * @property {"SerializedWorkerResult"} __type - Symbol-like to denote the type of object this is- */diff --git a/lib/nodejs/worker.js b/lib/nodejs/worker.jsindex cf5655e8..732f5feb 100644--- a/lib/nodejs/worker.js+++ b/lib/nodejs/worker.js@@ -6,6 +6,11 @@'use strict';+/**+ * @typedef {import('../types.d.ts').BufferedEvent} BufferedEvent+ * @typedef {import('../types.d.ts').MochaOptions} MochaOptions+ */+const {createInvalidArgumentTypeError,createInvalidArgumentValueError@@ -36,7 +41,7 @@ if (workerpool.isMainThread) {* **This function only runs once per worker**; it overwrites itself with a no-op* before returning.*- * @param {Options} argv - Command-line options+ * @param {MochaOptions} argv - Command-line options*/let bootstrap = async argv => {// globalSetup and globalTeardown do not run in workersdiff --git a/lib/plugin-loader.js b/lib/plugin-loader.jsindex 075ad91b..80934476 100644--- a/lib/plugin-loader.js+++ b/lib/plugin-loader.js@@ -1,3 +1,7 @@+/**+ * @typedef {import('./types.d.ts').PluginDefinition} PluginDefinition+ */+/*** Provides a way to load "plugins" as provided by the user.*@@ -18,6 +22,10 @@ const {} = require('./errors');const {castArray} = require('./utils');+/**+ * @typedef {import('./types.d.ts').PluginLoaderOptions} PluginLoaderOptions+ */+/*** Built-in plugin definitions.*/@@ -277,10 +285,3 @@ class PluginLoader {}module.exports = PluginLoader;--/**- * Options for {@link PluginLoader}- * @typedef {Object} PluginLoaderOptions- * @property {PluginDefinition[]} [pluginDefs] - Plugin definitions- * @property {string[]} [ignore] - A list of plugins to ignore when loading- */diff --git a/lib/reporters/base.js b/lib/reporters/base.jsindex e0ca5f48..bc210ca2 100644--- a/lib/reporters/base.js+++ b/lib/reporters/base.js@@ -1,4 +1,11 @@'use strict';++/**+ * @typedef {import('../runner.js')} Runner+ * @typedef {import('../test.js')} Test+ * @typedef {import('../types.d.ts').FullErrorStack} FullErrorStack+ */+/*** @module Base*/@@ -580,12 +587,3 @@ function sameType(a, b) {Base.consoleLog = consoleLog;Base.abstract = true;--/**- * An object with all stack traces recursively mounted from each err.cause- * @memberof module:lib/reporters/base- * @typedef {Object} FullErrorStack- * @property {string} message- * @property {string} msg- * @property {string} stack- */diff --git a/lib/reporters/doc.js b/lib/reporters/doc.jsindex b2c3e488..f018525e 100644--- a/lib/reporters/doc.js+++ b/lib/reporters/doc.js@@ -1,4 +1,9 @@'use strict';++/**+ * @typedef {import('../runner.js')} Runner+ */+/*** @module Doc*/diff --git a/lib/reporters/dot.js b/lib/reporters/dot.jsindex c67ac8ff..46e8b811 100644--- a/lib/reporters/dot.js+++ b/lib/reporters/dot.js@@ -1,4 +1,9 @@'use strict';++/**+ * @typedef {import('../runner.js')} Runner+ */+/*** @module Dot*/diff --git a/lib/reporters/html.js b/lib/reporters/html.jsindex 12880130..77e0abd3 100644--- a/lib/reporters/html.js+++ b/lib/reporters/html.js@@ -1,5 +1,9 @@'use strict';+/**+ * @typedef {import('../runner.js')} Runner+ */+/* eslint-env browser *//*** @module HTMLdiff --git a/lib/reporters/json-stream.js b/lib/reporters/json-stream.jsindex 5926587e..a57e4a35 100644--- a/lib/reporters/json-stream.js+++ b/lib/reporters/json-stream.js@@ -1,4 +1,10 @@'use strict';++/**+ * @typedef {import('../runner.js')} Runner+ * @typedef {import('../test.js')} Test+ */+/*** @module JSONStream*/@@ -55,16 +61,11 @@ function JSONStream(runner, options) {});}-/**- * Mocha event to be written to the output stream.- * @typedef {Array} JSONStream~MochaEvent- */-/*** Writes Mocha event to reporter output stream.** @private- * @param {JSONStream~MochaEvent} event - Mocha event to be output.+ * @param {unknown[]} event - Mocha event to be output.*/function writeEvent(event) {process.stdout.write(JSON.stringify(event) + '\n');diff --git a/lib/reporters/json.js b/lib/reporters/json.jsindex 5d39f9c5..f4e1a9d9 100644--- a/lib/reporters/json.js+++ b/lib/reporters/json.js@@ -1,4 +1,9 @@'use strict';++/**+ * @typedef {import('../runner.js')} Runner+ */+/*** @module JSON*/diff --git a/lib/reporters/landing.js b/lib/reporters/landing.jsindex 4188c7cd..e30e497a 100644--- a/lib/reporters/landing.js+++ b/lib/reporters/landing.js@@ -1,4 +1,9 @@'use strict';++/**+ * @typedef {import('../runner.js')} Runner+ */+/*** @module Landing*/diff --git a/lib/reporters/list.js b/lib/reporters/list.jsindex aebdd65e..66dd997d 100644--- a/lib/reporters/list.js+++ b/lib/reporters/list.js@@ -1,4 +1,9 @@'use strict';++/**+ * @typedef {import('../runner.js')} Runner+ */+/*** @module List*/diff --git a/lib/reporters/markdown.js b/lib/reporters/markdown.jsindex d5adfae1..2e196d6b 100644--- a/lib/reporters/markdown.js+++ b/lib/reporters/markdown.js@@ -1,4 +1,9 @@'use strict';++/**+ * @typedef {import('../runner.js')} Runner+ */+/*** @module Markdown*/diff --git a/lib/reporters/min.js b/lib/reporters/min.jsindex 4de98e6f..6571ec6f 100644--- a/lib/reporters/min.js+++ b/lib/reporters/min.js@@ -1,4 +1,9 @@'use strict';++/**+ * @typedef {import('../runner.js')} Runner+ */+/*** @module Min*/diff --git a/lib/reporters/nyan.js b/lib/reporters/nyan.jsindex 96de3659..aaeaf423 100644--- a/lib/reporters/nyan.js+++ b/lib/reporters/nyan.js@@ -1,4 +1,9 @@'use strict';++/**+ * @typedef {import('../runner.js')} Runner+ */+/*** @module Nyan*/diff --git a/lib/reporters/progress.js b/lib/reporters/progress.jsindex 4f6d8794..e25f4f91 100644--- a/lib/reporters/progress.js+++ b/lib/reporters/progress.js@@ -1,4 +1,9 @@'use strict';++/**+ * @typedef {import('../runner.js')} Runner+ */+/*** @module Progress*/diff --git a/lib/reporters/spec.js b/lib/reporters/spec.jsindex 8497249f..3d4dd1af 100644--- a/lib/reporters/spec.js+++ b/lib/reporters/spec.js@@ -1,4 +1,10 @@'use strict';++/**+ * @typedef {import('../runner.js')} Runner+ * @typedef {import('../test.js')} Test+ */+/*** @module Spec*/diff --git a/lib/reporters/tap.js b/lib/reporters/tap.jsindex a0a86c03..43e53b82 100644--- a/lib/reporters/tap.js+++ b/lib/reporters/tap.js@@ -1,4 +1,10 @@'use strict';++/**+ * @typedef {import('../runner.js')} Runner+ * @typedef {import('../test.js')} Test+ */+/*** @module TAP*/diff --git a/lib/reporters/xunit.js b/lib/reporters/xunit.jsindex 5c5339b9..77b71366 100644--- a/lib/reporters/xunit.js+++ b/lib/reporters/xunit.js@@ -1,4 +1,10 @@'use strict';++/**+ * @typedef {import('../runner.js')} Runner+ * @typedef {import('../test.js')} Test+ */+/*** @module XUnit*/diff --git a/lib/runner.js b/lib/runner.jsindex b717d575..555e919b 100644--- a/lib/runner.js+++ b/lib/runner.js@@ -1,5 +1,9 @@'use strict';+/**+ * @typedef {import('./types.d.ts').RunnerOptions} RunnerOptions+ */+/*** Module dependencies.* @private@@ -26,8 +30,8 @@ const {createUnsupportedError,createFatalError,isMochaError,- constants: errorConstants} = require('./errors');+const { constants: errorConstants } = require('./error-constants');/*** Non-enumerable globals.@@ -1068,9 +1072,7 @@ Runner.prototype._uncaught = function (err) {* @public* @memberof Runner* @param {Function} fn - Callback when finished- * @param {Object} [opts] - For subclasses- * @param {string[]} opts.files - Files to run- * @param {Options} opts.options - command-line options+ * @param {RunnerOptions} [opts] - For subclasses* @returns {Runner} Runner instance.*/Runner.prototype.run = function (fn, opts = {}) {diff --git a/lib/stats-collector.js b/lib/stats-collector.jsindex 738fd5d7..9eca0c00 100644--- a/lib/stats-collector.js+++ b/lib/stats-collector.js@@ -1,5 +1,10 @@'use strict';+/**+ * @typedef {import('./types.d.ts').StatsCollector} StatsCollector+ * @typedef {import('./runner.js')} Runner+ */+/*** Provides a factory function for a {@link StatsCollector} object.* @module@@ -14,21 +19,6 @@ var EVENT_TEST_PENDING = constants.EVENT_TEST_PENDING;var EVENT_RUN_END = constants.EVENT_RUN_END;var EVENT_TEST_END = constants.EVENT_TEST_END;-/**- * Test statistics collector.- *- * @public- * @typedef {Object} StatsCollector- * @property {number} suites - integer count of suites run.- * @property {number} tests - integer count of tests run.- * @property {number} passes - integer count of passing tests.- * @property {number} pending - integer count of pending tests.- * @property {number} failures - integer count of failed tests.- * @property {Date} start - time when testing began.- * @property {Date} end - time when testing concluded.- * @property {number} duration - number of msecs that testing took.- */-var Date = global.Date;/**@@ -40,7 +30,7 @@ var Date = global.Date;*/function createStatsCollector(runner) {/**- * @type StatsCollector+ * @type {StatsCollector}*/var stats = {suites: 0,diff --git a/lib/suite.js b/lib/suite.jsindex 7a695fc4..b321349f 100644--- a/lib/suite.js+++ b/lib/suite.js@@ -1,5 +1,9 @@'use strict';+/**+ * @typedef {import('./test.js')} Test+ */+/*** Module dependencies.* @privatediff --git a/lib/types.d.ts b/lib/types.d.tsnew file mode 100644index 00000000..8da230d2--- /dev/null+++ b/lib/types.d.ts@@ -0,0 +1,378 @@+/**+ * These types are a preliminary step towards moving Mocha's TypeScript types into Mocha.+ * They are not yet complete and are not yet fully used in the codebase.+ * For now, if you're an external user, you should use the types from @types/mocha.+ */++import type {FSWatcher} from 'chokidar';++import type {constants} from './error-constants.js';+import type Mocha from './mocha.js';+import Runner from './runner.js';++/**+ * Command-line options+ */+export interface MochaOptions {+ /** Propagate uncaught errors? */+ allowUncaught?: boolean;++ /** Force `done` callback or promise? */+ asyncOnly?: boolean;++ /** Bail after first test failure? */+ bail?: boolean;++ /** Check for global variable leaks? */+ checkLeaks?: boolean;++ /** Color TTY output from reporter? */+ color?: boolean;++ /** Delay root suite execution? */+ delay?: boolean;++ /** Show diff on failure? */+ diff?: boolean;++ /** Report tests without running them? */+ dryRun?: boolean;++ /** Fail test run if tests were failed? */+ passOnFailingTestSuite?: boolean;++ /** Fail test run if zero tests? */+ failZero?: boolean;++ /** Test filter given string. */+ fgrep?: string;++ /** Tests marked `only` fail the suite? */+ forbidOnly?: boolean;++ /** Pending tests fail the suite? */+ forbidPending?: boolean;++ /** Full stacktrace upon failure? */+ fullTrace?: boolean;++ /** Variables expected in global scope. */+ global?: string[];++ /** Test filter given regular expression. */+ grep?: RegExp;++ /** Display inline diffs? */+ inlineDiffs?: boolean;++ /** Invert test filter matches? */+ invert?: boolean;++ /** Disable syntax highlighting? */+ noHighlighting?: boolean;++ /** Reporter name or constructor. */+ reporter?: string | Reporter;++ /** Reporter settings object. */+ reporterOption?: Object;++ /** Number of times to retry failed tests. */+ retries?: number;++ /** Slow threshold value, in milliseconds. */+ slow?: number;++ /** Timeout threshold value, in milliseconds. */+ timeout?: number | string;++ /** Interface name. */+ ui?: string;++ /** Run jobs in parallel. */+ parallel?: boolean;++ /** Max number of worker processes for parallel runs. */+ jobs?: number;++ /** Hooks to bootstrap the root suite with. */+ rootHooks?: MochaRootHookObject;++ /** Pathname of `rootHooks` plugin for parallel runs. */+ require?: string[];++ /** Should be `true` if `Mocha` process is running in a worker process. */+ isWorker?: boolean;++ watch?: boolean;+ extension?: string[];+ recursive?: boolean;+ sort?: boolean;+ file?: string[];+ spec?: string[];+ ignore?: string[];+}++/**+ * Callback to be invoked when test execution is complete.+ *+ * @private+ * @param failures - Number of failures that occurred.+ */+export type DoneCB = (failures?: number) => void;++export interface RunnerOptions {+ /** Files to run */+ files?: string[];+ /** Command-line options */+ options?: object;+}++/**+ * An alternative way to define root hooks that works with parallel runs.+ */+export interface MochaRootHookObject {+ /** "Before all" hook(s) */+ beforeAll?: Function | Function[];+ /** "Before each" hook(s) */+ beforeEach?: Function | Function[];+ /** "After all" hook(s) */+ afterAll?: Function | Function[];+ /** "After each" hook(s)} */+ afterEach?: Function | Function[];+}++/**+ * A function that's invoked _once_ which is either sync or async.+ * Can be a "teardown" or "setup". These will all share the same context.+ */+export type MochaGlobalFixture = () => void | Promise<void>;++/**+ * An object making up all necessary parts of a plugin loader and aggregator+ */+export interface PluginDefinition {+ /**+ * Named export to use+ */+ exportName: string;+ /**+ * Option name for Mocha constructor (use `exportName` if omitted)+ */+ optionName?: string;+ /**+ * Validator function+ */+ validate?: PluginValidator;+ /**+ * Finalizer/aggregator function+ */+ finalize?: PluginFinalizer;+}++/**+ * A (sync) function to assert a user-supplied plugin implementation is valid.+ *+ * Defined in a {@link PluginDefinition}.++ * @param value Value to check+ * @this {PluginDefinition}+ */+export type PluginValidator = (this: PluginDefinition, value: unknown) => void;++/**+ * A function to finalize plugins implementations of a particular ilk+ * @param implementations User-supplied implementations+ */+export type PluginFinalizer = (+ implementations: unknown[]+) => Promise<unknown> | unknown;++/**+ * An object to configure how Mocha gathers test files+ */+export interface FileCollectionOptions {+ /** File extensions to use */+ extension?: string[];+ /** Files, dirs, globs to run */+ spec?: string[];+ /** Files, dirs, globs to ignore */+ ignore?: string[];+ /** List of additional files to include */+ file?: string[];+ /** Find files recursively */+ recursive?: boolean;+ /** Sort test files */+ sort?: boolean;+}++/**+ * Diagnostic object containing unmatched files+ */+export interface UnmatchedFile {+ /** The absolute path to the file */+ absolutePath: string;+ /** A list of unmatched files derived from the file arguments passed in */+ pattern: string;+}++/**+ * Response object containing a list of files to test and unmatched files.+ */+export interface FileCollectionResponse {+ /** A list of files to test */+ files: string[];+ /** A list of unmatched files derived from the file arguments passed in */+ unmatchedFiles: UnmatchedFile[];+}++/**+ * @private+ */+export interface BeforeWatchRunOptions {+ mocha: Mocha;+ watcher: FSWatcher;+}++/**+ * Callback to be run before `mocha.run()` is called.+ * Optionally, it can return a new `Mocha` instance.+ * @private+ */+export type BeforeWatchRun = (options: BeforeWatchRunOptions) => Mocha;++/**+ * Object containing run control methods+ * @private+ */+export interface Rerunner {+ /** Calls `mocha.run()` */+ run: Function;+ /** Schedules another call to `run */+ scheduleRun: Function;+}++export interface StatsCollector {+ /** integer count of suites run */+ suites: number;++ /** integer count of tests run */+ tests: number;++ /** integer count of passing tests */+ passes: number;++ /** integer count of pending tests */+ pending: number;++ /** integer count of failed tests */+ failures: number;++ /** time when testing began */+ start: Date;++ /** time when testing concluded */+ end: Date;++ /** number of msecs that testing took */+ duration: number;+}++export interface PluginLoaderOptions {+ /**+ * Plugin definitions+ */+ pluginDefs?: PluginDefinition;++ /**+ * A list of plugins to ignore when loading+ */+ ignore?: string[];+}++/**+ * @memberof module:lib/errors+ */+export interface MochaTimeoutError extends Error {+ code: typeof constants.TIMEOUT;++ /**+ * Timeout in ms+ */+ timeout?: number;++ /**+ * Filepath, if given+ */+ file?: string;+}++/**+ * The result of calling `SerializableEvent.serialize`, as received+ * by the deserializer.+ * @private+ */+export interface SerializedEvent {+ /** Optional serialized data */+ data?: object;++ /** Optional serialized `Error` */+ error?: Error;+}++/**+ * The result of calling `SerializableWorkerResult.serialize` as received+ * by the deserializer.+ * @private+ */+export interface SerializedWorkerResult {+ /** Number of failures */+ failureCount: number;++ /** Serialized events */+ events: SerializedEvent[];++ /** Symbol-like to denote the type of object this is */+ __type: 'SerializedWorkerResult';+}++/**+ * Listener function intended to be bound to `Process.SIGINT` event+ * @private+ */+export type SigIntListener = () => Promise<void>;++/**+ * A function accepting a test file path and returning the results of a test run+ * @private+ * @param filename - File to run+ */+export type FileRunner = (filename: string) => Promise<SerializedWorkerResult>;++/**+ * Serializable event data from a `Runner`. Keys of the `data` property+ * beginning with `__` will be converted into a function which returns the value+ * upon deserialization.+ */+export interface BufferedEvent {+ /** Event name */+ name: string;++ /** Event parameters */+ data: object;+}++/**+ * An object with all stack traces recursively mounted from each err.cause+ * @memberof module:lib/reporters/base+ */+export interface FullErrorStack {+ message: string;+ msg: string;+ stack: string;+}++export interface Reporter {+ new (runner: Runner, options: MochaOptions): Reporter;+ done?: (failures: number, callback: () => void) => void;+}diff --git a/package-lock.json b/package-lock.jsonindex 34d95f02..6744ef3a 100644--- a/package-lock.json+++ b/package-lock.json@@ -45,6 +45,8 @@"@rollup/plugin-multi-entry": "^4.0.1","@rollup/plugin-node-resolve": "^13.1.3","@test/esm-only-loader": "./test/compiler-fixtures/esm-only-loader",+ "@types/node": "^22.15.3",+ "@types/yargs": "^17.0.33","chai": "^4.3.4","coffeescript": "^2.6.1","cross-env": "^7.0.2",@@ -85,6 +87,7 @@"rollup-plugin-visualizer": "^5.6.0","semver": "^7.7.2","sinon": "^9.0.3",+ "typescript": "^5.8.3","unexpected": "^11.14.0","unexpected-eventemitter": "^2.2.0","unexpected-map": "^2.0.0",@@ -1974,10 +1977,11 @@}},"node_modules/@types/eslint": {- "version": "8.21.2",- "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.21.2.tgz",- "integrity": "sha512-EMpxUyystd3uZVByZap1DACsMXvb82ypQnGn89e1Y0a+LYu3JJscUd/gqhRsVFDkaD2MIiWo0MT8EfXr3DGRKw==",+ "version": "9.6.1",+ "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz",+ "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==","dev": true,+ "license": "MIT","dependencies": {"@types/estree": "*","@types/json-schema": "*"@@ -1994,10 +1998,11 @@}},"node_modules/@types/estree": {- "version": "0.0.39",- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",- "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",- "dev": true+ "version": "1.0.8",+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",+ "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",+ "dev": true,+ "license": "MIT"},"node_modules/@types/glob": {"version": "8.1.0",@@ -2080,10 +2085,14 @@"dev": true},"node_modules/@types/node": {- "version": "18.15.3",- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.3.tgz",- "integrity": "sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw==",- "dev": true+ "version": "22.18.0",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.18.0.tgz",+ "integrity": "sha512-m5ObIqwsUp6BZzyiy4RdZpzWGub9bqLJMvZDD0QMXhxjqMHMENlj+SqF5QxoUwaQNFe+8kz8XM8ZQhqkQPTgMQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "undici-types": "~6.21.0"+ }},"node_modules/@types/normalize-package-data": {"version": "2.4.4",@@ -2128,6 +2137,23 @@"integrity": "sha512-8oDqyLC7eD4HM307boe2QWKyuzdzWBj56xI/imSl2cpL+U3tCMaTAkMJ4ee5JBZ/FsOJlvRGeIShiZDAl1qERA==","dev": true},+ "node_modules/@types/yargs": {+ "version": "17.0.33",+ "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz",+ "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/yargs-parser": "*"+ }+ },+ "node_modules/@types/yargs-parser": {+ "version": "21.0.3",+ "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz",+ "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==",+ "dev": true,+ "license": "MIT"+ },"node_modules/@types/yauzl": {"version": "2.10.2","resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.2.tgz",@@ -2197,6 +2223,16 @@"node": ">=12.0.0"}},+ "node_modules/@wdio/config/node_modules/@types/node": {+ "version": "18.19.123",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.123.tgz",+ "integrity": "sha512-K7DIaHnh0mzVxreCR9qwgNxp3MH9dltPNIEddW9MYUlcKAzm+3grKNSTe2vCJHI1FaLpvpL5JGJrz1UZDKYvDg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "undici-types": "~5.26.4"+ }+ },"node_modules/@wdio/config/node_modules/@wdio/types": {"version": "7.33.0","resolved": "https://registry.npmjs.org/@wdio/types/-/types-7.33.0.tgz",@@ -2269,6 +2305,13 @@"node": ">=4.2.0"}},+ "node_modules/@wdio/config/node_modules/undici-types": {+ "version": "5.26.5",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",+ "dev": true,+ "license": "MIT"+ },"node_modules/@wdio/logger": {"version": "7.26.0","resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-7.26.0.tgz",@@ -2319,6 +2362,16 @@"node": ">=12.0.0"}},+ "node_modules/@wdio/utils/node_modules/@types/node": {+ "version": "18.19.123",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.123.tgz",+ "integrity": "sha512-K7DIaHnh0mzVxreCR9qwgNxp3MH9dltPNIEddW9MYUlcKAzm+3grKNSTe2vCJHI1FaLpvpL5JGJrz1UZDKYvDg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "undici-types": "~5.26.4"+ }+ },"node_modules/@wdio/utils/node_modules/@wdio/types": {"version": "7.33.0","resolved": "https://registry.npmjs.org/@wdio/types/-/types-7.33.0.tgz",@@ -2357,6 +2410,13 @@"node": ">=4.2.0"}},+ "node_modules/@wdio/utils/node_modules/undici-types": {+ "version": "5.26.5",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",+ "dev": true,+ "license": "MIT"+ },"node_modules/@webassemblyjs/ast": {"version": "1.11.1","resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz",@@ -5487,6 +5547,16 @@"integrity": "sha512-nEzHZteIUZfGCZtTiS1fRpC8UZmsfD1SiyPvaUNvS13dvKf666OAm8YTi0+Ca3n1nLEyu49Cy4+dPWpaHFJk9g==","dev": true},+ "node_modules/devtools/node_modules/@types/node": {+ "version": "18.19.123",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.123.tgz",+ "integrity": "sha512-K7DIaHnh0mzVxreCR9qwgNxp3MH9dltPNIEddW9MYUlcKAzm+3grKNSTe2vCJHI1FaLpvpL5JGJrz1UZDKYvDg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "undici-types": "~5.26.4"+ }+ },"node_modules/devtools/node_modules/@wdio/types": {"version": "7.33.0","resolved": "https://registry.npmjs.org/@wdio/types/-/types-7.33.0.tgz",@@ -5680,6 +5750,13 @@"node": ">=4.2.0"}},+ "node_modules/devtools/node_modules/undici-types": {+ "version": "5.26.5",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",+ "dev": true,+ "license": "MIT"+ },"node_modules/devtools/node_modules/uuid": {"version": "9.0.1","resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",@@ -15644,12 +15721,11 @@}},"node_modules/typescript": {- "version": "5.5.4",- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz",- "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==",+ "version": "5.9.2",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz",+ "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==","dev": true,"license": "Apache-2.0",- "peer": true,"bin": {"tsc": "bin/tsc","tsserver": "bin/tsserver"@@ -15742,6 +15818,13 @@"integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==","dev": true},+ "node_modules/undici-types": {+ "version": "6.21.0",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",+ "dev": true,+ "license": "MIT"+ },"node_modules/unexpected": {"version": "11.15.1","resolved": "https://registry.npmjs.org/unexpected/-/unexpected-11.15.1.tgz",@@ -16239,6 +16322,16 @@"node": ">=12.0.0"}},+ "node_modules/webdriver/node_modules/@types/node": {+ "version": "18.19.123",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.123.tgz",+ "integrity": "sha512-K7DIaHnh0mzVxreCR9qwgNxp3MH9dltPNIEddW9MYUlcKAzm+3grKNSTe2vCJHI1FaLpvpL5JGJrz1UZDKYvDg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "undici-types": "~5.26.4"+ }+ },"node_modules/webdriver/node_modules/@wdio/types": {"version": "7.33.0","resolved": "https://registry.npmjs.org/@wdio/types/-/types-7.33.0.tgz",@@ -16277,6 +16370,13 @@"node": ">=4.2.0"}},+ "node_modules/webdriver/node_modules/undici-types": {+ "version": "5.26.5",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",+ "dev": true,+ "license": "MIT"+ },"node_modules/webdriverio": {"version": "7.33.0","resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-7.33.0.tgz",@@ -16315,6 +16415,16 @@"node": ">=12.0.0"}},+ "node_modules/webdriverio/node_modules/@types/node": {+ "version": "18.19.123",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.123.tgz",+ "integrity": "sha512-K7DIaHnh0mzVxreCR9qwgNxp3MH9dltPNIEddW9MYUlcKAzm+3grKNSTe2vCJHI1FaLpvpL5JGJrz1UZDKYvDg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "undici-types": "~5.26.4"+ }+ },"node_modules/webdriverio/node_modules/@wdio/types": {"version": "7.33.0","resolved": "https://registry.npmjs.org/@wdio/types/-/types-7.33.0.tgz",@@ -16409,6 +16519,13 @@"node": ">=4.2.0"}},+ "node_modules/webdriverio/node_modules/undici-types": {+ "version": "5.26.5",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",+ "dev": true,+ "license": "MIT"+ },"node_modules/webpack": {"version": "5.76.1","resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.1.tgz",@@ -16534,12 +16651,6 @@"node": ">=10.13.0"}},- "node_modules/webpack/node_modules/@types/estree": {- "version": "0.0.51",- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz",- "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==",- "dev": true- },"node_modules/whatwg-encoding": {"version": "2.0.0","resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz",@@ -18102,7 +18213,7 @@"integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==","dev": true,"requires": {- "@types/estree": "0.0.39",+ "@types/estree": "^1.0.7","estree-walker": "^1.0.1","picomatch": "^2.2.2"},@@ -18246,12 +18357,12 @@}},"@types/eslint": {- "version": "8.21.2",- "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.21.2.tgz",- "integrity": "sha512-EMpxUyystd3uZVByZap1DACsMXvb82ypQnGn89e1Y0a+LYu3JJscUd/gqhRsVFDkaD2MIiWo0MT8EfXr3DGRKw==",+ "version": "9.6.1",+ "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz",+ "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==","dev": true,"requires": {- "@types/estree": "*",+ "@types/estree": "^1.0.7","@types/json-schema": "*"}},@@ -18261,14 +18372,14 @@"integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==","dev": true,"requires": {- "@types/eslint": "*",- "@types/estree": "*"+ "@types/eslint": "^9.6.1",+ "@types/estree": "^1.0.7"}},"@types/estree": {- "version": "0.0.39",- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",- "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",+ "version": "1.0.8",+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",+ "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==","dev": true},"@types/glob": {@@ -18354,10 +18465,13 @@"dev": true},"@types/node": {- "version": "18.15.3",- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.3.tgz",- "integrity": "sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw==",- "dev": true+ "version": "22.18.0",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.18.0.tgz",+ "integrity": "sha512-m5ObIqwsUp6BZzyiy4RdZpzWGub9bqLJMvZDD0QMXhxjqMHMENlj+SqF5QxoUwaQNFe+8kz8XM8ZQhqkQPTgMQ==",+ "dev": true,+ "requires": {+ "undici-types": "~6.21.0"+ }},"@types/normalize-package-data": {"version": "2.4.4",@@ -18401,6 +18515,21 @@"integrity": "sha512-8oDqyLC7eD4HM307boe2QWKyuzdzWBj56xI/imSl2cpL+U3tCMaTAkMJ4ee5JBZ/FsOJlvRGeIShiZDAl1qERA==","dev": true},+ "@types/yargs": {+ "version": "17.0.33",+ "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz",+ "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==",+ "dev": true,+ "requires": {+ "@types/yargs-parser": "*"+ }+ },+ "@types/yargs-parser": {+ "version": "21.0.3",+ "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz",+ "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==",+ "dev": true+ },"@types/yauzl": {"version": "2.10.2","resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.2.tgz",@@ -18455,6 +18584,15 @@"glob": "^8.0.3"},"dependencies": {+ "@types/node": {+ "version": "18.19.123",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.123.tgz",+ "integrity": "sha512-K7DIaHnh0mzVxreCR9qwgNxp3MH9dltPNIEddW9MYUlcKAzm+3grKNSTe2vCJHI1FaLpvpL5JGJrz1UZDKYvDg==",+ "dev": true,+ "requires": {+ "undici-types": "~5.26.4"+ }+ },"@wdio/types": {"version": "7.33.0","resolved": "https://registry.npmjs.org/@wdio/types/-/types-7.33.0.tgz",@@ -18494,6 +18632,12 @@"dev": true,"optional": true,"peer": true+ },+ "undici-types": {+ "version": "5.26.5",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",+ "dev": true}}},@@ -18535,6 +18679,15 @@"p-iteration": "^1.1.8"},"dependencies": {+ "@types/node": {+ "version": "18.19.123",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.123.tgz",+ "integrity": "sha512-K7DIaHnh0mzVxreCR9qwgNxp3MH9dltPNIEddW9MYUlcKAzm+3grKNSTe2vCJHI1FaLpvpL5JGJrz1UZDKYvDg==",+ "dev": true,+ "requires": {+ "undici-types": "~5.26.4"+ }+ },"@wdio/types": {"version": "7.33.0","resolved": "https://registry.npmjs.org/@wdio/types/-/types-7.33.0.tgz",@@ -18552,6 +18705,12 @@"dev": true,"optional": true,"peer": true+ },+ "undici-types": {+ "version": "5.26.5",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",+ "dev": true}}},@@ -21097,6 +21256,15 @@"uuid": "^9.0.0"},"dependencies": {+ "@types/node": {+ "version": "18.19.123",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.123.tgz",+ "integrity": "sha512-K7DIaHnh0mzVxreCR9qwgNxp3MH9dltPNIEddW9MYUlcKAzm+3grKNSTe2vCJHI1FaLpvpL5JGJrz1UZDKYvDg==",+ "dev": true,+ "requires": {+ "undici-types": "~5.26.4"+ }+ },"@wdio/types": {"version": "7.33.0","resolved": "https://registry.npmjs.org/@wdio/types/-/types-7.33.0.tgz",@@ -21227,6 +21395,12 @@"optional": true,"peer": true},+ "undici-types": {+ "version": "5.26.5",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",+ "dev": true+ },"uuid": {"version": "9.0.1","resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",@@ -23404,7 +23578,7 @@"integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==","dev": true,"requires": {- "@types/estree": "*"+ "@types/estree": "^1.0.7"}},"is-regex": {@@ -28776,11 +28950,10 @@}},"typescript": {- "version": "5.5.4",- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz",- "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==",- "dev": true,- "peer": true+ "version": "5.9.2",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz",+ "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",+ "dev": true},"ua-parser-js": {"version": "1.0.34",@@ -28835,6 +29008,12 @@"integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==","dev": true},+ "undici-types": {+ "version": "6.21.0",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",+ "dev": true+ },"unexpected": {"version": "11.15.1","resolved": "https://registry.npmjs.org/unexpected/-/unexpected-11.15.1.tgz",@@ -29213,6 +29392,15 @@"lodash.merge": "^4.6.1"},"dependencies": {+ "@types/node": {+ "version": "18.19.123",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.123.tgz",+ "integrity": "sha512-K7DIaHnh0mzVxreCR9qwgNxp3MH9dltPNIEddW9MYUlcKAzm+3grKNSTe2vCJHI1FaLpvpL5JGJrz1UZDKYvDg==",+ "dev": true,+ "requires": {+ "undici-types": "~5.26.4"+ }+ },"@wdio/types": {"version": "7.33.0","resolved": "https://registry.npmjs.org/@wdio/types/-/types-7.33.0.tgz",@@ -29230,6 +29418,12 @@"dev": true,"optional": true,"peer": true+ },+ "undici-types": {+ "version": "5.26.5",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",+ "dev": true}}},@@ -29268,6 +29462,15 @@"webdriver": "7.33.0"},"dependencies": {+ "@types/node": {+ "version": "18.19.123",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.123.tgz",+ "integrity": "sha512-K7DIaHnh0mzVxreCR9qwgNxp3MH9dltPNIEddW9MYUlcKAzm+3grKNSTe2vCJHI1FaLpvpL5JGJrz1UZDKYvDg==",+ "dev": true,+ "requires": {+ "undici-types": "~5.26.4"+ }+ },"@wdio/types": {"version": "7.33.0","resolved": "https://registry.npmjs.org/@wdio/types/-/types-7.33.0.tgz",@@ -29320,6 +29523,12 @@"dev": true,"optional": true,"peer": true+ },+ "undici-types": {+ "version": "5.26.5",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",+ "dev": true}}},@@ -29330,7 +29539,7 @@"dev": true,"requires": {"@types/eslint-scope": "^3.7.3",- "@types/estree": "^0.0.51",+ "@types/estree": "^1.0.7","@webassemblyjs/ast": "1.11.1","@webassemblyjs/wasm-edit": "1.11.1","@webassemblyjs/wasm-parser": "1.11.1",@@ -29353,14 +29562,6 @@"terser-webpack-plugin": "^5.1.3","watchpack": "^2.4.0","webpack-sources": "^3.2.3"- },- "dependencies": {- "@types/estree": {- "version": "0.0.51",- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz",- "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==",- "dev": true- }}},"webpack-cli": {diff --git a/package.json b/package.jsonindex 79d402c4..d439cac7 100644--- a/package.json+++ b/package.json@@ -91,6 +91,7 @@"test-node": "run-s test-coverage-clean test-node:* test-coverage-generate","test-smoke": "node ./bin/mocha --no-config test/smoke/smoke.spec.js","test": "run-s lint test-node test-browser",+ "tsc": "tsc","version:linkify-changelog": "node scripts/linkify-changelog.mjs","version:update-authors": "node scripts/update-authors.js","version": "run-p version:* && git add -A ./AUTHORS ./CHANGELOG.md"@@ -127,6 +128,8 @@"@rollup/plugin-json": "^4.1.0","@rollup/plugin-multi-entry": "^4.0.1","@rollup/plugin-node-resolve": "^13.1.3",+ "@types/node": "^22.15.3",+ "@types/yargs": "^17.0.33","@test/esm-only-loader": "./test/compiler-fixtures/esm-only-loader","chai": "^4.3.4","coffeescript": "^2.6.1",@@ -168,6 +171,7 @@"rollup-plugin-visualizer": "^5.6.0","semver": "^7.7.2","sinon": "^9.0.3",+ "typescript": "^5.8.3","unexpected": "^11.14.0","unexpected-eventemitter": "^2.2.0","unexpected-map": "^2.0.0",@@ -208,6 +212,8 @@"trailingComma": "none"},"overrides": {+ "@types/eslint": "^9.6.1",+ "@types/estree": "^1.0.7","webdriverio": "^7.33.0"}}diff --git a/test/integration/multiple-done.spec.js b/test/integration/multiple-done.spec.jsindex 70e142b4..d6056530 100644--- a/test/integration/multiple-done.spec.js+++ b/test/integration/multiple-done.spec.js@@ -2,7 +2,7 @@var runMochaJSON = require('./helpers').runMochaJSON;var invokeMocha = require('./helpers').invokeMocha;-var MULTIPLE_DONE = require('../../lib/errors').constants.MULTIPLE_DONE;+var MULTIPLE_DONE = require('../../lib/error-constants').constants.MULTIPLE_DONE;describe('multiple calls to done()', function () {var res;diff --git a/test/node-unit/cli/options.spec.js b/test/node-unit/cli/options.spec.jsindex 15f38fcb..e9d62670 100644--- a/test/node-unit/cli/options.spec.js+++ b/test/node-unit/cli/options.spec.js@@ -3,7 +3,7 @@const sinon = require('sinon');const rewiremock = require('rewiremock/node');const {ONE_AND_DONE_ARGS} = require('../../../lib/cli/one-and-dones');-const {constants} = require('../../../lib/errors');+const {constants} = require('../../../lib/error-constants');const modulePath = require.resolve('../../../lib/cli/options');const mocharcPath = require.resolve('../../../lib/mocharc.json');diff --git a/test/unit/errors.spec.js b/test/unit/errors.spec.jsindex 09f56c68..a36376fc 100644--- a/test/unit/errors.spec.js+++ b/test/unit/errors.spec.js@@ -1,6 +1,7 @@'use strict';var errors = require('../../lib/errors');+var constants = require('../../lib/error-constants');const sinon = require('sinon');const {createNoFilesMatchPatternError} = require('../../lib/errors');@@ -48,7 +49,7 @@ describe('Errors', function () {'to satisfy',{message: /parallel/,- code: errors.constants.FORBIDDEN_EXCLUSIVITY+ code: constants.FORBIDDEN_EXCLUSIVITY});});@@ -62,7 +63,7 @@ describe('Errors', function () {'to satisfy',{message: /--forbid-only/,- code: errors.constants.FORBIDDEN_EXCLUSIVITY+ code: constants.FORBIDDEN_EXCLUSIVITY});});diff --git a/test/unit/plugin-loader.spec.js b/test/unit/plugin-loader.spec.jsindex 80fbca57..257d6d05 100644--- a/test/unit/plugin-loader.spec.js+++ b/test/unit/plugin-loader.spec.js@@ -3,7 +3,7 @@const PluginLoader = require('../../lib/plugin-loader');const sinon = require('sinon');const {INVALID_PLUGIN_DEFINITION, INVALID_PLUGIN_IMPLEMENTATION} =- require('../../lib/errors').constants;+ require('../../lib/error-constants').constants;describe('plugin module', function () {describe('class PluginLoader', function () {diff --git a/test/unit/runnable.spec.js b/test/unit/runnable.spec.jsindex 88e39bc0..7739ba2a 100644--- a/test/unit/runnable.spec.js+++ b/test/unit/runnable.spec.js@@ -4,7 +4,7 @@ var Mocha = require('../../lib/mocha');var Runnable = Mocha.Runnable;var Suite = Mocha.Suite;var sinon = require('sinon');-const {TIMEOUT} = require('../../lib/errors').constants;+const {TIMEOUT} = require('../../lib/error-constants').constants;var STATE_FAILED = Runnable.constants.STATE_FAILED;describe('Runnable(title, fn)', function () {diff --git a/test/unit/runner.spec.js b/test/unit/runner.spec.jsindex fd29661b..7487ddfb 100644--- a/test/unit/runner.spec.js+++ b/test/unit/runner.spec.js@@ -7,7 +7,7 @@ const Pending = require('../../lib/pending');const {Suite, Runner, Test, Hook, Runnable} = Mocha;const {noop} = Mocha.utils;const {FATAL, MULTIPLE_DONE, UNSUPPORTED} =- require('../../lib/errors').constants;+ require('../../lib/error-constants').constants;const {EVENT_HOOK_BEGIN,diff --git a/tsconfig.json b/tsconfig.jsonnew file mode 100644index 00000000..c2da5879--- /dev/null+++ b/tsconfig.json@@ -0,0 +1,11 @@+{+ "compilerOptions": {+ "allowJs": true,+ "module": "Node16",+ "resolveJsonModule": true,+ "target": "ES2022",+ "noEmit": true+ },+ "exclude": ["lib/browser"],+ "include": ["lib"]+}