From 9fbb57641773cfe512ba246eb149b824e5584c1d Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Fri, 6 Feb 2026 17:33:01 +0100 Subject: [PATCH] refactor(test): migrate from mocha to node:test/assert --- .mocharc.json | 3 - index.test.js | 1 + lint/fixer/common-errors.test.js | 1 + lint/fixer/flags.test.js | 1 + lint/fixer/overlap.test.js | 1 + lint/fixer/status.test.js | 1 + lint/linter/test-browsers-data.test.js | 1 + lint/linter/test-browsers-presence.test.js | 1 + lint/linter/test-consistency.test.js | 1 + lint/linter/test-descriptions.test.js | 1 + lint/linter/test-filename.test.js | 1 + lint/linter/test-links.test.js | 1 + lint/linter/test-mirror.test.js | 1 + lint/linter/test-multiple-statements.test.js | 1 + lint/linter/test-obsolete.test.js | 1 + lint/linter/test-overlap.test.js | 1 + lint/linter/test-prefix.test.js | 1 + lint/linter/test-status.test.js | 1 + lint/linter/test-tags.test.js | 1 + lint/linter/test-versions.test.js | 1 + lint/utils.test.js | 1 + package-lock.json | 398 ------------------ package.json | 4 +- scripts/build/index.test.js | 1 + scripts/build/mirror.test.js | 1 + scripts/lib/compare-features.test.js | 1 + scripts/lib/compare-statements.test.js | 1 + scripts/lib/pluralize.test.js | 1 + .../stringify-and-order-properties.test.js | 1 + .../002-remove-webview-flags.test.js | 1 + .../migrations/007-experimental-false.test.js | 1 + scripts/statistics.test.js | 1 + scripts/traverse.test.js | 1 + scripts/update-browser-releases/edge.test.js | 1 + utils/iter-support.test.js | 1 + utils/normalize-path.test.js | 1 + utils/query.test.js | 1 + utils/walk.test.js | 1 + utils/walkingUtils.test.js | 1 + 39 files changed, 37 insertions(+), 404 deletions(-) delete mode 100644 .mocharc.json diff --git a/.mocharc.json b/.mocharc.json deleted file mode 100644 index a1de89109b0d29..00000000000000 --- a/.mocharc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extensions": ["js"] -} diff --git a/index.test.js b/index.test.js index 83a90c0144fd6c..4033caa89533fc 100644 --- a/index.test.js +++ b/index.test.js @@ -3,6 +3,7 @@ /** @import {CompatStatement} from './types/types.js' */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import bcd from './index.js'; diff --git a/lint/fixer/common-errors.test.js b/lint/fixer/common-errors.test.js index e3e01140ef6ecb..dae9f8d991d024 100644 --- a/lint/fixer/common-errors.test.js +++ b/lint/fixer/common-errors.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import { fixCommonErrorsInCompatStatement } from './common-errors.js'; diff --git a/lint/fixer/flags.test.js b/lint/fixer/flags.test.js index 24790f5af0c055..3f755440c920c8 100644 --- a/lint/fixer/flags.test.js +++ b/lint/fixer/flags.test.js @@ -3,6 +3,7 @@ /** @import {SupportStatement} from '../../types/types.js' */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import { removeIrrelevantFlags } from './flags.js'; diff --git a/lint/fixer/overlap.test.js b/lint/fixer/overlap.test.js index 932bff58d90ee7..3086710870ac8e 100644 --- a/lint/fixer/overlap.test.js +++ b/lint/fixer/overlap.test.js @@ -3,6 +3,7 @@ /** @import {SupportStatement} from '../../types/types.js' */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import { checkOverlap } from '../common/overlap.js'; diff --git a/lint/fixer/status.test.js b/lint/fixer/status.test.js index e5f179ca46c471..497839817477d5 100644 --- a/lint/fixer/status.test.js +++ b/lint/fixer/status.test.js @@ -7,6 +7,7 @@ * @typedef {Record} TestValue */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import { fixStatusValue } from './status.js'; diff --git a/lint/linter/test-browsers-data.test.js b/lint/linter/test-browsers-data.test.js index 89e47c124bd777..60041ac9c2caf3 100644 --- a/lint/linter/test-browsers-data.test.js +++ b/lint/linter/test-browsers-data.test.js @@ -3,6 +3,7 @@ /** @import {BrowserStatement} from '../../types/types.js' */ +import { describe, it, beforeEach } from 'node:test'; import assert from 'node:assert/strict'; import { Logger } from '../utils.js'; diff --git a/lint/linter/test-browsers-presence.test.js b/lint/linter/test-browsers-presence.test.js index bc9a1dd797a2a5..8c5c6d367b836f 100644 --- a/lint/linter/test-browsers-presence.test.js +++ b/lint/linter/test-browsers-presence.test.js @@ -3,6 +3,7 @@ /** @import {InternalSupportBlock} from '../../types/index.js' */ +import { describe, it, beforeEach } from 'node:test'; import assert from 'node:assert/strict'; import { Logger } from '../utils.js'; diff --git a/lint/linter/test-consistency.test.js b/lint/linter/test-consistency.test.js index 763a28c86e9b67..e5471ffc639860 100644 --- a/lint/linter/test-consistency.test.js +++ b/lint/linter/test-consistency.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import { ConsistencyChecker } from './test-consistency.js'; diff --git a/lint/linter/test-descriptions.test.js b/lint/linter/test-descriptions.test.js index ba4449e8adcd14..c4adee65d32d43 100644 --- a/lint/linter/test-descriptions.test.js +++ b/lint/linter/test-descriptions.test.js @@ -4,6 +4,7 @@ /** @import {CompatStatement} from '../../types/types.js' */ /** @import {DescriptionError} from './test-descriptions.js' */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import { processData } from './test-descriptions.js'; diff --git a/lint/linter/test-filename.test.js b/lint/linter/test-filename.test.js index fe34b39d84747b..ee1da5c61d775f 100644 --- a/lint/linter/test-filename.test.js +++ b/lint/linter/test-filename.test.js @@ -3,6 +3,7 @@ /** @import {Identifier} from '../../types/types.js' */ +import { describe, it, beforeEach } from 'node:test'; import assert from 'node:assert/strict'; import { Logger } from '../utils.js'; diff --git a/lint/linter/test-links.test.js b/lint/linter/test-links.test.js index 9400debaa3ffa8..560b52e76cb56c 100644 --- a/lint/linter/test-links.test.js +++ b/lint/linter/test-links.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import { processData } from './test-links.js'; diff --git a/lint/linter/test-mirror.test.js b/lint/linter/test-mirror.test.js index 92f24a0d2cf8fe..2df6e9a81f5592 100644 --- a/lint/linter/test-mirror.test.js +++ b/lint/linter/test-mirror.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it, beforeEach } from 'node:test'; import assert from 'node:assert/strict'; import { Logger } from '../utils.js'; diff --git a/lint/linter/test-multiple-statements.test.js b/lint/linter/test-multiple-statements.test.js index abafad8808a54d..4393b84c791ec7 100644 --- a/lint/linter/test-multiple-statements.test.js +++ b/lint/linter/test-multiple-statements.test.js @@ -3,6 +3,7 @@ /** @import {InternalDataType} from '../../types/index.js' */ +import { describe, it, beforeEach } from 'node:test'; import assert from 'node:assert/strict'; import { Logger } from '../utils.js'; diff --git a/lint/linter/test-obsolete.test.js b/lint/linter/test-obsolete.test.js index 13cec0ad51f089..48b7d9a7cbd128 100644 --- a/lint/linter/test-obsolete.test.js +++ b/lint/linter/test-obsolete.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import bcd from '../../index.js'; diff --git a/lint/linter/test-overlap.test.js b/lint/linter/test-overlap.test.js index 6bba710712a147..0bbac5e3bd55d2 100644 --- a/lint/linter/test-overlap.test.js +++ b/lint/linter/test-overlap.test.js @@ -3,6 +3,7 @@ /** @import {CompatStatement} from '../../types/types.js' */ +import { describe, it, beforeEach } from 'node:test'; import assert from 'node:assert/strict'; import { Logger } from '../utils.js'; diff --git a/lint/linter/test-prefix.test.js b/lint/linter/test-prefix.test.js index 24cf0db6c24605..656152bb052af9 100644 --- a/lint/linter/test-prefix.test.js +++ b/lint/linter/test-prefix.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it, beforeEach } from 'node:test'; import assert from 'node:assert/strict'; import { Logger } from '../utils.js'; diff --git a/lint/linter/test-status.test.js b/lint/linter/test-status.test.js index 126afc9f56603f..723a39478847f4 100644 --- a/lint/linter/test-status.test.js +++ b/lint/linter/test-status.test.js @@ -3,6 +3,7 @@ /** @import {CompatStatement} from '../../types/types.js' */ +import { describe, it, beforeEach } from 'node:test'; import assert from 'node:assert/strict'; import { Logger } from '../utils.js'; diff --git a/lint/linter/test-tags.test.js b/lint/linter/test-tags.test.js index 6c60855833b399..b04c1e4464b9d1 100644 --- a/lint/linter/test-tags.test.js +++ b/lint/linter/test-tags.test.js @@ -3,6 +3,7 @@ /** @import {CompatStatement} from '../../types/types.js' */ +import { describe, it, beforeEach } from 'node:test'; import assert from 'node:assert/strict'; import { Logger } from '../utils.js'; diff --git a/lint/linter/test-versions.test.js b/lint/linter/test-versions.test.js index b099d5fdeba7fc..cf0933ed20e8b9 100644 --- a/lint/linter/test-versions.test.js +++ b/lint/linter/test-versions.test.js @@ -3,6 +3,7 @@ /** @import {InternalSupportBlock} from '../../types/index.js' */ +import { describe, it, beforeEach } from 'node:test'; import assert from 'node:assert/strict'; import { Logger } from '../utils.js'; diff --git a/lint/utils.test.js b/lint/utils.test.js index 3f331b9564aee2..86a8f326ccaae0 100644 --- a/lint/utils.test.js +++ b/lint/utils.test.js @@ -3,6 +3,7 @@ /** @import {SimpleSupportStatement} from '../types/types.js' */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import { diff --git a/package-lock.json b/package-lock.json index 9f44e411d22e5c..88e090ad55e300 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,6 @@ "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.20.0", "@types/deep-diff": "~1.0.1", - "@types/mocha": "~10.0.0", "@types/node": "~24.10.3", "@types/yargs": "~17.0.10", "ajv": "~8.17.1", @@ -44,7 +43,6 @@ "lefthook": "^2.0.0", "markdown-table": "^3.0.4", "marked": "^17.0.0", - "mocha": "~11.7.1", "open-cli": "~8.0.0", "ora": "~9.3.0", "prettier": "~3.8.0", @@ -625,13 +623,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/mocha": { - "version": "10.0.10", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", - "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/node": { "version": "24.10.11", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.11.tgz", @@ -1305,13 +1296,6 @@ "concat-map": "0.0.1" } }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true, - "license": "ISC" - }, "node_modules/browserslist": { "version": "4.28.1", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", @@ -1586,19 +1570,6 @@ "node": ">=6" } }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/caniuse-lite": { "version": "1.0.30001766", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001766.tgz", @@ -1656,22 +1627,6 @@ "dev": true, "license": "MIT" }, - "node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/ci-info": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz", @@ -1992,19 +1947,6 @@ } } }, - "node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/deep-diff": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/deep-diff/-/deep-diff-1.0.2.tgz", @@ -3017,16 +2959,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true, - "license": "BSD-3-Clause", - "bin": { - "flat": "cli.js" - } - }, "node_modules/flat-cache": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", @@ -3412,16 +3344,6 @@ "node": ">= 0.4" } }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true, - "license": "MIT", - "bin": { - "he": "bin/he" - } - }, "node_modules/html-entities": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.6.0.tgz", @@ -3842,26 +3764,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-regex": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", @@ -3974,19 +3876,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-weakmap": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", @@ -4456,56 +4345,6 @@ "dev": true, "license": "MIT" }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-symbols/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/log-symbols/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", @@ -4635,186 +4474,6 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/mocha": { - "version": "11.7.5", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.5.tgz", - "integrity": "sha512-mTT6RgopEYABzXWFx+GcJ+ZQ32kp4fMf0xvpZIIfSq9Z8lC/++MtcCnQ9t5FP2veYEP95FIYSvW+U9fV4xrlig==", - "dev": true, - "license": "MIT", - "dependencies": { - "browser-stdout": "^1.3.1", - "chokidar": "^4.0.1", - "debug": "^4.3.5", - "diff": "^7.0.0", - "escape-string-regexp": "^4.0.0", - "find-up": "^5.0.0", - "glob": "^10.4.5", - "he": "^1.2.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "log-symbols": "^4.1.0", - "minimatch": "^9.0.5", - "ms": "^2.1.3", - "picocolors": "^1.1.1", - "serialize-javascript": "^6.0.2", - "strip-json-comments": "^3.1.1", - "supports-color": "^8.1.1", - "workerpool": "^9.2.0", - "yargs": "^17.7.2", - "yargs-parser": "^21.1.1", - "yargs-unparser": "^2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha.js" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/mocha/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/mocha/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/mocha/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/mocha/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/mocha/node_modules/diff": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", - "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/mocha/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/mocha/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/mocha/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/mocha/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/mocha/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -5318,16 +4977,6 @@ "node": ">=6" } }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, "node_modules/readable-stream": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", @@ -5362,20 +5011,6 @@ "url": "https://github.com/sponsors/Borewit" } }, - "node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -5643,16 +5278,6 @@ "semver": "bin/semver.js" } }, - "node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "randombytes": "^2.1.0" - } - }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -6650,13 +6275,6 @@ "node": ">=0.10.0" } }, - "node_modules/workerpool": { - "version": "9.3.3", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.3.tgz", - "integrity": "sha512-slxCaKbYjEdFT/o2rH9xS1hf4uRDch1w7Uo+apxhZ+sf/1d9e0ZVkn42kPNGP2dgjIx6YFvSevj0zHvbWe2jdw==", - "dev": true, - "license": "Apache-2.0" - }, "node_modules/wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -6836,22 +6454,6 @@ "node": ">=12" } }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "license": "MIT", - "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/yargs/node_modules/emoji-regex": { "version": "10.4.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", diff --git a/package.json b/package.json index 81327361a44ee7..c927ef25fb6d76 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,6 @@ "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.20.0", "@types/deep-diff": "~1.0.1", - "@types/mocha": "~10.0.0", "@types/node": "~24.10.3", "@types/yargs": "~17.0.10", "ajv": "~8.17.1", @@ -85,7 +84,6 @@ "lefthook": "^2.0.0", "markdown-table": "^3.0.4", "marked": "^17.0.0", - "mocha": "~11.7.1", "open-cli": "~8.0.0", "ora": "~9.3.0", "prettier": "~3.8.0", @@ -102,7 +100,7 @@ "prepare": "npm run gentypes && npm run build", "diff": "node scripts/diff.js", "diff:flat": "node scripts/diff-flat.js", - "unittest": "NODE_ENV=test FORCE_COLOR=1 c8 mocha index.test.js --recursive \"{,!(node_modules)/**}/*.test.js\"", + "unittest": "NODE_ENV=test FORCE_COLOR=1 c8 node --test --test-reporter=spec './{,!(node_modules)/**/}*.test.js'", "coverage": "c8 report -r lcov && open-cli coverage/lcov-report/index.html", "format": "eslint --cache . && prettier --check --cache . && tsc --noEmit", "format:fix": "eslint --quiet --fix --cache . && prettier --write --cache .", diff --git a/scripts/build/index.test.js b/scripts/build/index.test.js index dacd61e96a7e24..5e039e6e1b3155 100644 --- a/scripts/build/index.test.js +++ b/scripts/build/index.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import { walk } from '../../utils/index.js'; diff --git a/scripts/build/mirror.test.js b/scripts/build/mirror.test.js index 30468fe4bda99e..b6810b2d4e1f09 100644 --- a/scripts/build/mirror.test.js +++ b/scripts/build/mirror.test.js @@ -6,6 +6,7 @@ * @import { InternalSupportBlock } from '../../types/index.js' */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import bcd from '../../index.js'; diff --git a/scripts/lib/compare-features.test.js b/scripts/lib/compare-features.test.js index 7d95def7c53dc5..46a0b17eb01a42 100644 --- a/scripts/lib/compare-features.test.js +++ b/scripts/lib/compare-features.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import compareFeatures from './compare-features.js'; diff --git a/scripts/lib/compare-statements.test.js b/scripts/lib/compare-statements.test.js index 00bc6aafa0dc7e..a4e039d3b04b2e 100644 --- a/scripts/lib/compare-statements.test.js +++ b/scripts/lib/compare-statements.test.js @@ -3,6 +3,7 @@ /** @import {Identifier, CompatStatement} from '../../types/types.js' */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import compareStatements from './compare-statements.js'; diff --git a/scripts/lib/pluralize.test.js b/scripts/lib/pluralize.test.js index 5815807b4b4b93..949f1c6bb77664 100644 --- a/scripts/lib/pluralize.test.js +++ b/scripts/lib/pluralize.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import pluralize from './pluralize.js'; diff --git a/scripts/lib/stringify-and-order-properties.test.js b/scripts/lib/stringify-and-order-properties.test.js index 68bbc485b27214..0b6c29de8f95c4 100644 --- a/scripts/lib/stringify-and-order-properties.test.js +++ b/scripts/lib/stringify-and-order-properties.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import stringifyAndOrderProperties from './stringify-and-order-properties.js'; diff --git a/scripts/migrations/002-remove-webview-flags.test.js b/scripts/migrations/002-remove-webview-flags.test.js index 27105daace4e1b..81fcf67e0cadb1 100644 --- a/scripts/migrations/002-remove-webview-flags.test.js +++ b/scripts/migrations/002-remove-webview-flags.test.js @@ -3,6 +3,7 @@ /** @import {Identifier} from '../../types/types.js' */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import { removeWebViewFlags } from './002-remove-webview-flags.js'; diff --git a/scripts/migrations/007-experimental-false.test.js b/scripts/migrations/007-experimental-false.test.js index 52cbac5465d4f2..20ceca757939cc 100644 --- a/scripts/migrations/007-experimental-false.test.js +++ b/scripts/migrations/007-experimental-false.test.js @@ -3,6 +3,7 @@ /** @import {CompatStatement} from '../../types/types.js' */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import { fixExperimental } from './007-experimental-false.js'; diff --git a/scripts/statistics.test.js b/scripts/statistics.test.js index 79290905577ed9..298e05abd11110 100644 --- a/scripts/statistics.test.js +++ b/scripts/statistics.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it, beforeEach } from 'node:test'; import assert from 'node:assert/strict'; import getStats from './statistics.js'; diff --git a/scripts/traverse.test.js b/scripts/traverse.test.js index 5de768144235f7..50845d138ba816 100644 --- a/scripts/traverse.test.js +++ b/scripts/traverse.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it, beforeEach } from 'node:test'; import assert from 'node:assert/strict'; import { iterateFeatures } from './traverse.js'; diff --git a/scripts/update-browser-releases/edge.test.js b/scripts/update-browser-releases/edge.test.js index 8d4a91d6b416fe..df8d1d8e3ea070 100644 --- a/scripts/update-browser-releases/edge.test.js +++ b/scripts/update-browser-releases/edge.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import { parseReleaseDate } from './edge.js'; diff --git a/utils/iter-support.test.js b/utils/iter-support.test.js index ac6b6a31f135f3..891dd7e546b71b 100644 --- a/utils/iter-support.test.js +++ b/utils/iter-support.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import iterSupport from './iter-support.js'; diff --git a/utils/normalize-path.test.js b/utils/normalize-path.test.js index 63d7a675405780..43710e684cb63a 100644 --- a/utils/normalize-path.test.js +++ b/utils/normalize-path.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe } from 'node:test'; import assert from 'node:assert/strict'; import { normalizePathInternal } from './normalize-path.js'; diff --git a/utils/query.test.js b/utils/query.test.js index 4dc5353db99ad3..f70a0fe7b67f51 100644 --- a/utils/query.test.js +++ b/utils/query.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import query from './query.js'; diff --git a/utils/walk.test.js b/utils/walk.test.js index a5bf6d1d5f4d72..d977998d41543f 100644 --- a/utils/walk.test.js +++ b/utils/walk.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import dataFolders from '../scripts/lib/data-folders.js'; diff --git a/utils/walkingUtils.test.js b/utils/walkingUtils.test.js index c3ffffc17fe620..a7a7b53d2fb48d 100644 --- a/utils/walkingUtils.test.js +++ b/utils/walkingUtils.test.js @@ -1,6 +1,7 @@ /* This file is a part of @mdn/browser-compat-data * See LICENSE file for more information. */ +import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import bcd from '../index.js';