diff --git a/.pnp.cjs b/.pnp.cjs index 1dbbffdda..5fe4eeff6 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -6485,6 +6485,7 @@ const RAW_RUNTIME_STATE = ["eslint-plugin-n", "virtual:3b04c8c38dde7165df844f9cd74e94cc47d78164564600cf56ba5f8c6011d25ef0d3afc13d610f3da970f6807c830914053ff96a43c86ba17f3ec650dfd687d3#npm:17.7.0"],\ ["eslint-plugin-no-null", "virtual:a59b12f7fe7bf3b80fc61d73eaaa33af60483f6ce31789d384fbe8ef169791f667d2559ec5f2fbae1a273a658ce021f1f5f1ea0718c56f81b30ad4e95a5668dd#npm:1.0.2"],\ ["eslint-plugin-prefer-arrow", "virtual:a59b12f7fe7bf3b80fc61d73eaaa33af60483f6ce31789d384fbe8ef169791f667d2559ec5f2fbae1a273a658ce021f1f5f1ea0718c56f81b30ad4e95a5668dd#npm:1.2.3"],\ + ["glob", "npm:10.4.1"],\ ["mocha", "npm:10.3.0"],\ ["npm-run-all2", "npm:6.1.2"],\ ["rimraf", "npm:5.0.5"],\ @@ -10984,6 +10985,18 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ + ["npm:10.4.1", {\ + "packageLocation": "./.yarn/cache/glob-npm-10.4.1-a0d030e0a9-d7bb49d2b4.zip/node_modules/glob/",\ + "packageDependencies": [\ + ["glob", "npm:10.4.1"],\ + ["foreground-child", "npm:3.1.1"],\ + ["jackspeak", "npm:3.4.0"],\ + ["minimatch", "npm:9.0.4"],\ + ["minipass", "npm:7.1.2"],\ + ["path-scurry", "npm:1.11.1"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:6.0.1", {\ "packageLocation": "./.yarn/cache/glob-npm-6.0.1-8e9c8956b1-a0670bc51f.zip/node_modules/glob/",\ "packageDependencies": [\ @@ -12188,6 +12201,15 @@ const RAW_RUNTIME_STATE = ["@pkgjs/parseargs", "npm:0.11.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:3.4.0", {\ + "packageLocation": "./.yarn/cache/jackspeak-npm-3.4.0-fdc2c6fcce-5032c43c0c.zip/node_modules/jackspeak/",\ + "packageDependencies": [\ + ["jackspeak", "npm:3.4.0"],\ + ["@isaacs/cliui", "npm:8.0.2"],\ + ["@pkgjs/parseargs", "npm:0.11.0"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["jasmine", [\ @@ -13506,6 +13528,13 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ + ["npm:10.2.2", {\ + "packageLocation": "./.yarn/cache/lru-cache-npm-10.2.2-c54b721fc3-ff1a496d30.zip/node_modules/lru-cache/",\ + "packageDependencies": [\ + ["lru-cache", "npm:10.2.2"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:4.1.5", {\ "packageLocation": "./.yarn/cache/lru-cache-npm-4.1.5-ede304cc43-9ec7d73f11.zip/node_modules/lru-cache/",\ "packageDependencies": [\ @@ -13836,6 +13865,13 @@ const RAW_RUNTIME_STATE = ["minipass", "npm:7.0.4"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:7.1.2", {\ + "packageLocation": "./.yarn/cache/minipass-npm-7.1.2-3a5327d36d-c25f0ee819.zip/node_modules/minipass/",\ + "packageDependencies": [\ + ["minipass", "npm:7.1.2"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["minipass-collect", [\ @@ -15028,6 +15064,15 @@ const RAW_RUNTIME_STATE = ["minipass", "npm:7.0.4"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:1.11.1", {\ + "packageLocation": "./.yarn/cache/path-scurry-npm-1.11.1-aaf8c339af-5e8845c159.zip/node_modules/path-scurry/",\ + "packageDependencies": [\ + ["path-scurry", "npm:1.11.1"],\ + ["lru-cache", "npm:10.2.2"],\ + ["minipass", "npm:7.0.4"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["path-to-regexp", [\ diff --git a/.yarn/cache/glob-npm-10.4.1-a0d030e0a9-d7bb49d2b4.zip b/.yarn/cache/glob-npm-10.4.1-a0d030e0a9-d7bb49d2b4.zip new file mode 100644 index 000000000..8d44135f2 Binary files /dev/null and b/.yarn/cache/glob-npm-10.4.1-a0d030e0a9-d7bb49d2b4.zip differ diff --git a/.yarn/cache/jackspeak-npm-3.4.0-fdc2c6fcce-5032c43c0c.zip b/.yarn/cache/jackspeak-npm-3.4.0-fdc2c6fcce-5032c43c0c.zip new file mode 100644 index 000000000..04721e4ed Binary files /dev/null and b/.yarn/cache/jackspeak-npm-3.4.0-fdc2c6fcce-5032c43c0c.zip differ diff --git a/.yarn/cache/lru-cache-npm-10.2.2-c54b721fc3-ff1a496d30.zip b/.yarn/cache/lru-cache-npm-10.2.2-c54b721fc3-ff1a496d30.zip new file mode 100644 index 000000000..7e71190c3 Binary files /dev/null and b/.yarn/cache/lru-cache-npm-10.2.2-c54b721fc3-ff1a496d30.zip differ diff --git a/.yarn/cache/minipass-npm-7.1.2-3a5327d36d-c25f0ee819.zip b/.yarn/cache/minipass-npm-7.1.2-3a5327d36d-c25f0ee819.zip new file mode 100644 index 000000000..4c88fb60c Binary files /dev/null and b/.yarn/cache/minipass-npm-7.1.2-3a5327d36d-c25f0ee819.zip differ diff --git a/.yarn/cache/path-scurry-npm-1.11.1-aaf8c339af-5e8845c159.zip b/.yarn/cache/path-scurry-npm-1.11.1-aaf8c339af-5e8845c159.zip new file mode 100644 index 000000000..40cc3d66f Binary files /dev/null and b/.yarn/cache/path-scurry-npm-1.11.1-aaf8c339af-5e8845c159.zip differ diff --git a/packages/allure-mocha/package.json b/packages/allure-mocha/package.json index 2eeba9eb6..504ed1748 100644 --- a/packages/allure-mocha/package.json +++ b/packages/allure-mocha/package.json @@ -80,6 +80,7 @@ "eslint-plugin-n": "^17.0.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-prefer-arrow": "^1.2.3", + "glob": "^10.4.1", "mocha": "^10.2.0", "npm-run-all2": "^6.1.2", "rimraf": "^5.0.1", diff --git a/packages/allure-mocha/test/fixtures/runner.js b/packages/allure-mocha/test/fixtures/runner.js index 548d1e642..6cd8cb191 100644 --- a/packages/allure-mocha/test/fixtures/runner.js +++ b/packages/allure-mocha/test/fixtures/runner.js @@ -1,8 +1,8 @@ -// cjs: const { opendir } = require("fs/promises"); +// cjs: const { Glob } = require("glob"); // cjs: const path = require("path"); // cjs: const Mocha = require("mocha"); // cjs: const AllureReporter = require("allure-mocha"); -// esm: import { opendir } from "fs/promises"; +// esm: import { Glob } from "glob"; // esm: import path from "path"; // esm: import { fileURLToPath } from "url"; // esm: import Mocha from "mocha"; @@ -44,18 +44,10 @@ const mocha = new Mocha({ color: false, }); -const specFilePattern = /\.spec\./; - -const loadSpecFiles = async () => { - for await (const node of await opendir(dirname, { recursive: true })) { - if (node.isFile() && specFilePattern.test(node.name)) { - mocha.addFile(path.join(node.path ?? node.parentPath, node.name)); - } - } -}; - const run = async () => { - await loadSpecFiles(); + for await (const file of new Glob("./**/*.spec.*", {})) { + mocha.addFile(path.resolve(file)); + } await mocha.loadFilesAsync(); mocha.run((failures) => process.exit(failures)); }; diff --git a/yarn.lock b/yarn.lock index 8daa5729f..bf52c3d69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4497,6 +4497,7 @@ __metadata: eslint-plugin-n: "npm:^17.0.0" eslint-plugin-no-null: "npm:^1.0.2" eslint-plugin-prefer-arrow: "npm:^1.2.3" + glob: "npm:^10.4.1" mocha: "npm:^10.2.0" npm-run-all2: "npm:^6.1.2" rimraf: "npm:^5.0.1" @@ -8436,6 +8437,21 @@ __metadata: languageName: node linkType: hard +"glob@npm:^10.4.1": + version: 10.4.1 + resolution: "glob@npm:10.4.1" + dependencies: + foreground-child: "npm:^3.1.0" + jackspeak: "npm:^3.1.2" + minimatch: "npm:^9.0.4" + minipass: "npm:^7.1.2" + path-scurry: "npm:^1.11.1" + bin: + glob: dist/esm/bin.mjs + checksum: 10/d7bb49d2b413f77bdd59fea4ca86dcc12450deee221af0ca93e09534b81b9ef68fe341345751d8ff0c5b54bad422307e0e44266ff8ad7fbbd0c200e8ec258b16 + languageName: node + linkType: hard + "glob@npm:^6.0.1": version: 6.0.4 resolution: "glob@npm:6.0.4" @@ -9474,6 +9490,19 @@ __metadata: languageName: node linkType: hard +"jackspeak@npm:^3.1.2": + version: 3.4.0 + resolution: "jackspeak@npm:3.4.0" + dependencies: + "@isaacs/cliui": "npm:^8.0.2" + "@pkgjs/parseargs": "npm:^0.11.0" + dependenciesMeta: + "@pkgjs/parseargs": + optional: true + checksum: 10/5032c43c0c1fb92e72846ce496df559214253bc6870c90399cbd7858571c53169d9494b7c152df04abcb75f2fb5e9cffe65651c67d573380adf3a482b150d84b + languageName: node + linkType: hard + "jasmine-core@npm:~3.99.0": version: 3.99.1 resolution: "jasmine-core@npm:3.99.1" @@ -10614,6 +10643,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^10.2.0": + version: 10.2.2 + resolution: "lru-cache@npm:10.2.2" + checksum: 10/ff1a496d30b5eaec2c9079080965bb0cede203cf878371f7033a007f1e54cd4aa13cc8abf7ccec4c994a83a22ed5476e83a55bb57cc07e6c1547a42937e42c37 + languageName: node + linkType: hard + "lru-cache@npm:^4.0.1": version: 4.1.5 resolution: "lru-cache@npm:4.1.5" @@ -10972,6 +11008,13 @@ __metadata: languageName: node linkType: hard +"minipass@npm:^7.1.2": + version: 7.1.2 + resolution: "minipass@npm:7.1.2" + checksum: 10/c25f0ee8196d8e6036661104bacd743785b2599a21de5c516b32b3fa2b83113ac89a2358465bc04956baab37ffb956ae43be679b2262bf7be15fce467ccd7950 + languageName: node + linkType: hard + "minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": version: 2.1.2 resolution: "minizlib@npm:2.1.2" @@ -12024,6 +12067,16 @@ __metadata: languageName: node linkType: hard +"path-scurry@npm:^1.11.1": + version: 1.11.1 + resolution: "path-scurry@npm:1.11.1" + dependencies: + lru-cache: "npm:^10.2.0" + minipass: "npm:^5.0.0 || ^6.0.2 || ^7.0.0" + checksum: 10/5e8845c159261adda6f09814d7725683257fcc85a18f329880ab4d7cc1d12830967eae5d5894e453f341710d5484b8fdbbd4d75181b4d6e1eb2f4dc7aeadc434 + languageName: node + linkType: hard + "path-to-regexp@npm:^6.2.0, path-to-regexp@npm:^6.2.1": version: 6.2.1 resolution: "path-to-regexp@npm:6.2.1"