@rstest/core 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +127 -0
- package/dist/0~204.js +83 -0
- package/dist/0~223.js +18 -19
- package/dist/0~33.js +10 -20
- package/dist/0~493.js +0 -21
- package/dist/0~603.js +5 -2
- package/dist/0~655.js +3198 -8
- package/dist/0~655.js.LICENSE.txt +264 -0
- package/dist/0~691.js +58 -9
- package/dist/{0~938.js → 0~816.js} +179 -17
- package/dist/0~85.js +20 -45
- package/dist/{0~669.js → 0~876.js} +24 -20
- package/dist/{0~120.js → 0~908.js} +333 -5
- package/dist/0~928.js +1 -1
- package/dist/0~967.js +1 -1
- package/dist/0~969.js +1 -1
- package/dist/0~971.js +2 -2
- package/dist/index.js +566 -57
- package/dist/worker.js +674 -22
- package/dist-types/index.d.ts +241 -20
- package/dist-types/worker.d.ts +221 -18
- package/package.json +7 -5
package/LICENSE.md
CHANGED
|
@@ -578,6 +578,32 @@ Licensed under MIT license.
|
|
|
578
578
|
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
579
579
|
> SOFTWARE.
|
|
580
580
|
|
|
581
|
+
### chai
|
|
582
|
+
|
|
583
|
+
Licensed under MIT license in the repository at https://github.com/chaijs/chai.
|
|
584
|
+
|
|
585
|
+
> MIT License
|
|
586
|
+
>
|
|
587
|
+
> Copyright (c) 2017 Chai.js Assertion Library
|
|
588
|
+
>
|
|
589
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
590
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
591
|
+
> in the Software without restriction, including without limitation the rights
|
|
592
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
593
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
594
|
+
> furnished to do so, subject to the following conditions:
|
|
595
|
+
>
|
|
596
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
597
|
+
> copies or substantial portions of the Software.
|
|
598
|
+
>
|
|
599
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
600
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
601
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
602
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
603
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
604
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
605
|
+
> SOFTWARE.
|
|
606
|
+
|
|
581
607
|
### chalk
|
|
582
608
|
|
|
583
609
|
Licensed under MIT license.
|
|
@@ -735,6 +761,81 @@ Licensed under MIT license in the repository at https://github.com/rich-harris/m
|
|
|
735
761
|
>
|
|
736
762
|
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
737
763
|
|
|
764
|
+
### pathe
|
|
765
|
+
|
|
766
|
+
Licensed under MIT license.
|
|
767
|
+
|
|
768
|
+
> MIT License
|
|
769
|
+
>
|
|
770
|
+
> Copyright (c) Pooya Parsa <pooya@pi0.io> - Daniel Roe <daniel@roe.dev>
|
|
771
|
+
>
|
|
772
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
773
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
774
|
+
> in the Software without restriction, including without limitation the rights
|
|
775
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
776
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
777
|
+
> furnished to do so, subject to the following conditions:
|
|
778
|
+
>
|
|
779
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
780
|
+
> copies or substantial portions of the Software.
|
|
781
|
+
>
|
|
782
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
783
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
784
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
785
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
786
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
787
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
788
|
+
> SOFTWARE.
|
|
789
|
+
>
|
|
790
|
+
> ---
|
|
791
|
+
>
|
|
792
|
+
> Copyright Joyent, Inc. and other Node contributors.
|
|
793
|
+
>
|
|
794
|
+
> Permission is hereby granted, free of charge, to any person obtaining a
|
|
795
|
+
> copy of this software and associated documentation files (the
|
|
796
|
+
> "Software"), to deal in the Software without restriction, including
|
|
797
|
+
> without limitation the rights to use, copy, modify, merge, publish,
|
|
798
|
+
> distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
799
|
+
> persons to whom the Software is furnished to do so, subject to the
|
|
800
|
+
> following conditions:
|
|
801
|
+
>
|
|
802
|
+
> The above copyright notice and this permission notice shall be included
|
|
803
|
+
> in all copies or substantial portions of the Software.
|
|
804
|
+
>
|
|
805
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
806
|
+
> OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
807
|
+
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
808
|
+
> NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
809
|
+
> DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
810
|
+
> OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
811
|
+
> USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
812
|
+
>
|
|
813
|
+
> ---
|
|
814
|
+
>
|
|
815
|
+
> Bundled zeptomatch (https://github.com/fabiospampinato/zeptomatch)
|
|
816
|
+
>
|
|
817
|
+
> The MIT License (MIT)
|
|
818
|
+
>
|
|
819
|
+
> Copyright (c) 2023-present Fabio Spampinato
|
|
820
|
+
>
|
|
821
|
+
> Permission is hereby granted, free of charge, to any person obtaining a
|
|
822
|
+
> copy of this software and associated documentation files (the "Software"),
|
|
823
|
+
> to deal in the Software without restriction, including without limitation
|
|
824
|
+
> the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
825
|
+
> and/or sell copies of the Software, and to permit persons to whom the
|
|
826
|
+
> Software is furnished to do so, subject to the following conditions:
|
|
827
|
+
>
|
|
828
|
+
> The above copyright notice and this permission notice shall be included in
|
|
829
|
+
> all copies or substantial portions of the Software.
|
|
830
|
+
>
|
|
831
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
832
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
833
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
834
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
835
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
836
|
+
> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
837
|
+
> DEALINGS IN THE SOFTWARE.
|
|
838
|
+
|
|
738
839
|
### picocolors
|
|
739
840
|
|
|
740
841
|
Licensed under ISC license.
|
|
@@ -916,6 +1017,32 @@ Licensed under MIT license in the repository at git+https://github.com/errwischt
|
|
|
916
1017
|
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
917
1018
|
> SOFTWARE.
|
|
918
1019
|
|
|
1020
|
+
### std-env
|
|
1021
|
+
|
|
1022
|
+
Licensed under MIT license.
|
|
1023
|
+
|
|
1024
|
+
> MIT License
|
|
1025
|
+
>
|
|
1026
|
+
> Copyright (c) Pooya Parsa <pooya@pi0.io>
|
|
1027
|
+
>
|
|
1028
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1029
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
1030
|
+
> in the Software without restriction, including without limitation the rights
|
|
1031
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1032
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
1033
|
+
> furnished to do so, subject to the following conditions:
|
|
1034
|
+
>
|
|
1035
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
1036
|
+
> copies or substantial portions of the Software.
|
|
1037
|
+
>
|
|
1038
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1039
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1040
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1041
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1042
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1043
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1044
|
+
> SOFTWARE.
|
|
1045
|
+
|
|
919
1046
|
### strip-ansi
|
|
920
1047
|
|
|
921
1048
|
Licensed under MIT license.
|
package/dist/0~204.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
export const __webpack_id__ = "204";
|
|
4
|
+
export const __webpack_ids__ = [
|
|
5
|
+
"204"
|
|
6
|
+
];
|
|
7
|
+
export const __webpack_modules__ = {
|
|
8
|
+
"./src/coverage/generate.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
9
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
10
|
+
generateCoverage: ()=>generateCoverage
|
|
11
|
+
});
|
|
12
|
+
var pathe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs");
|
|
13
|
+
var tinyglobby__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs");
|
|
14
|
+
var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/utils/index.ts");
|
|
15
|
+
const getIncludedFiles = async (coverage, rootPath)=>{
|
|
16
|
+
const ignoredPatterns = coverage.exclude?.filter((item)=>(0, tinyglobby__WEBPACK_IMPORTED_MODULE_1__.ey)(item) || item.startsWith(rootPath) || item.startsWith('./'));
|
|
17
|
+
const allFiles = await (0, tinyglobby__WEBPACK_IMPORTED_MODULE_1__.glob)(coverage.include, {
|
|
18
|
+
cwd: rootPath,
|
|
19
|
+
absolute: true,
|
|
20
|
+
onlyFiles: true,
|
|
21
|
+
ignore: ignoredPatterns,
|
|
22
|
+
dot: true,
|
|
23
|
+
expandDirectories: false
|
|
24
|
+
});
|
|
25
|
+
if (ignoredPatterns?.length !== coverage.exclude?.length) {
|
|
26
|
+
const excludes = coverage.exclude.filter((item)=>!(0, tinyglobby__WEBPACK_IMPORTED_MODULE_1__.ey)(item) && !item.startsWith(rootPath) && !item.startsWith('./'));
|
|
27
|
+
return allFiles.filter((file)=>!excludes.some((exclude)=>file.includes(exclude)));
|
|
28
|
+
}
|
|
29
|
+
return allFiles;
|
|
30
|
+
};
|
|
31
|
+
async function generateCoverage(context, results, coverageProvider) {
|
|
32
|
+
const { rootPath, normalizedConfig: { coverage }, projects } = context;
|
|
33
|
+
try {
|
|
34
|
+
const finalCoverageMap = coverageProvider.createCoverageMap();
|
|
35
|
+
for (const result of results)if (result.coverage) finalCoverageMap.merge(result.coverage);
|
|
36
|
+
if (coverage.include?.length) {
|
|
37
|
+
const coveredFiles = finalCoverageMap.files();
|
|
38
|
+
let isTimeout = false;
|
|
39
|
+
const timeoutId = setTimeout(()=>{
|
|
40
|
+
isTimeout = true;
|
|
41
|
+
_utils__WEBPACK_IMPORTED_MODULE_0__.vF.info('Generating coverage for untested files...');
|
|
42
|
+
}, 1000);
|
|
43
|
+
const allFiles = (await Promise.all(projects.map(async (p)=>{
|
|
44
|
+
const includedFiles = await getIncludedFiles(coverage, p.rootPath);
|
|
45
|
+
const uncoveredFiles = includedFiles.filter((file)=>!coveredFiles.includes((0, pathe__WEBPACK_IMPORTED_MODULE_2__.n)(file)));
|
|
46
|
+
if (uncoveredFiles.length) await generateCoverageForUntestedFiles(p.environmentName, uncoveredFiles, finalCoverageMap, coverageProvider);
|
|
47
|
+
return includedFiles;
|
|
48
|
+
}))).flat();
|
|
49
|
+
clearTimeout(timeoutId);
|
|
50
|
+
if (isTimeout) _utils__WEBPACK_IMPORTED_MODULE_0__.vF.info('Coverage for untested files generated.');
|
|
51
|
+
finalCoverageMap.filter((file)=>allFiles.includes((0, pathe__WEBPACK_IMPORTED_MODULE_2__.n)(file)));
|
|
52
|
+
}
|
|
53
|
+
await coverageProvider.generateReports(finalCoverageMap, coverage);
|
|
54
|
+
if (coverage.thresholds) {
|
|
55
|
+
const { checkThresholds } = await __webpack_require__.e("691").then(__webpack_require__.bind(__webpack_require__, "./src/coverage/checkThresholds.ts"));
|
|
56
|
+
const thresholdResult = checkThresholds({
|
|
57
|
+
coverageMap: finalCoverageMap,
|
|
58
|
+
coverageProvider,
|
|
59
|
+
rootPath,
|
|
60
|
+
thresholds: coverage.thresholds
|
|
61
|
+
});
|
|
62
|
+
if (!thresholdResult.success) {
|
|
63
|
+
_utils__WEBPACK_IMPORTED_MODULE_0__.vF.log('');
|
|
64
|
+
_utils__WEBPACK_IMPORTED_MODULE_0__.vF.log(thresholdResult.message);
|
|
65
|
+
process.exitCode = 1;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
} catch (error) {
|
|
69
|
+
_utils__WEBPACK_IMPORTED_MODULE_0__.vF.error('Failed to generate coverage reports:', error);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async function generateCoverageForUntestedFiles(environmentName, uncoveredFiles, coverageMap, coverageProvider) {
|
|
73
|
+
if (!coverageProvider.generateCoverageForUntestedFiles) return void _utils__WEBPACK_IMPORTED_MODULE_0__.vF.warn('Current coverage provider does not support generating coverage for untested files.');
|
|
74
|
+
const coverages = await coverageProvider.generateCoverageForUntestedFiles({
|
|
75
|
+
environmentName,
|
|
76
|
+
files: uncoveredFiles
|
|
77
|
+
});
|
|
78
|
+
coverages.forEach((coverageData)=>{
|
|
79
|
+
coverageMap.addFileCoverage(coverageData);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
package/dist/0~223.js
CHANGED
|
@@ -10,12 +10,12 @@ export const __webpack_modules__ = {
|
|
|
10
10
|
initCli: ()=>initCli
|
|
11
11
|
});
|
|
12
12
|
var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("node:fs");
|
|
13
|
-
var
|
|
13
|
+
var pathe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs");
|
|
14
14
|
var tinyglobby__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("../../node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs");
|
|
15
|
-
var
|
|
16
|
-
var
|
|
15
|
+
var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/config.ts");
|
|
16
|
+
var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/utils/index.ts");
|
|
17
17
|
async function resolveConfig(options) {
|
|
18
|
-
const { content: config, filePath: configFilePath } = await (0,
|
|
18
|
+
const { content: config, filePath: configFilePath } = await (0, _config__WEBPACK_IMPORTED_MODULE_1__.Z9)({
|
|
19
19
|
cwd: options.root,
|
|
20
20
|
path: options.config,
|
|
21
21
|
configLoader: options.configLoader
|
|
@@ -42,13 +42,13 @@ export const __webpack_modules__ = {
|
|
|
42
42
|
'testEnvironment'
|
|
43
43
|
];
|
|
44
44
|
for (const key of keys)if (void 0 !== options[key]) config[key] = options[key];
|
|
45
|
-
if (options.reporter) config.reporters = (0,
|
|
45
|
+
if (options.reporter) config.reporters = (0, _utils__WEBPACK_IMPORTED_MODULE_2__.bg)(options.reporter);
|
|
46
46
|
if (void 0 !== options.coverage) {
|
|
47
47
|
config.coverage ??= {};
|
|
48
48
|
config.coverage.enabled = options.coverage;
|
|
49
49
|
}
|
|
50
|
-
if (options.exclude) config.exclude = (0,
|
|
51
|
-
if (options.include) config.include = (0,
|
|
50
|
+
if (options.exclude) config.exclude = (0, _utils__WEBPACK_IMPORTED_MODULE_2__.bg)(options.exclude);
|
|
51
|
+
if (options.include) config.include = (0, _utils__WEBPACK_IMPORTED_MODULE_2__.bg)(options.include);
|
|
52
52
|
return {
|
|
53
53
|
config,
|
|
54
54
|
configFilePath: configFilePath ?? void 0
|
|
@@ -57,9 +57,9 @@ export const __webpack_modules__ = {
|
|
|
57
57
|
async function resolveProjects({ config, root, options }) {
|
|
58
58
|
if (!config.projects) return [];
|
|
59
59
|
const getDefaultProjectName = (dir)=>{
|
|
60
|
-
const pkgJsonPath = (0,
|
|
60
|
+
const pkgJsonPath = (0, pathe__WEBPACK_IMPORTED_MODULE_3__.r)(dir, 'package.json');
|
|
61
61
|
const name = (0, node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(pkgJsonPath) ? JSON.parse((0, node_fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync)(pkgJsonPath, 'utf-8')).name : '';
|
|
62
|
-
if ('string' != typeof name || !name) return (0,
|
|
62
|
+
if ('string' != typeof name || !name) return (0, pathe__WEBPACK_IMPORTED_MODULE_3__.c)(dir);
|
|
63
63
|
return name;
|
|
64
64
|
};
|
|
65
65
|
const globProjects = async (patterns)=>{
|
|
@@ -76,10 +76,9 @@ export const __webpack_modules__ = {
|
|
|
76
76
|
};
|
|
77
77
|
return (0, tinyglobby__WEBPACK_IMPORTED_MODULE_4__.glob)(patterns, globOptions);
|
|
78
78
|
};
|
|
79
|
-
const formatRootStr = (rootStr)=>rootStr.replace('<rootDir>', root);
|
|
80
79
|
const { projectPaths, projectPatterns, projectConfigs } = (config.projects || []).reduce((total, p)=>{
|
|
81
80
|
if ('object' == typeof p) {
|
|
82
|
-
const projectRoot = p.root ?
|
|
81
|
+
const projectRoot = p.root ? (0, _utils__WEBPACK_IMPORTED_MODULE_2__.tS)(p.root, root) : root;
|
|
83
82
|
total.projectConfigs.push({
|
|
84
83
|
config: {
|
|
85
84
|
root: projectRoot,
|
|
@@ -90,10 +89,10 @@ export const __webpack_modules__ = {
|
|
|
90
89
|
});
|
|
91
90
|
return total;
|
|
92
91
|
}
|
|
93
|
-
const projectStr =
|
|
92
|
+
const projectStr = (0, _utils__WEBPACK_IMPORTED_MODULE_2__.tS)(p, root);
|
|
94
93
|
if ((0, tinyglobby__WEBPACK_IMPORTED_MODULE_4__.ey)(projectStr)) total.projectPatterns.push(projectStr);
|
|
95
94
|
else {
|
|
96
|
-
const absolutePath = (0,
|
|
95
|
+
const absolutePath = (0, _utils__WEBPACK_IMPORTED_MODULE_2__.FI)(root, projectStr);
|
|
97
96
|
if (!(0, node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(absolutePath)) throw `Can't resolve project "${p}", please make sure "${p}" is a existing file or a directory.`;
|
|
98
97
|
total.projectPaths.push(absolutePath);
|
|
99
98
|
}
|
|
@@ -109,19 +108,19 @@ export const __webpack_modules__ = {
|
|
|
109
108
|
const { config, configFilePath } = await resolveConfig({
|
|
110
109
|
...options,
|
|
111
110
|
config: isDirectory ? void 0 : project,
|
|
112
|
-
root: isDirectory ? project : (0,
|
|
111
|
+
root: isDirectory ? project : (0, pathe__WEBPACK_IMPORTED_MODULE_3__.d)(project)
|
|
113
112
|
});
|
|
114
113
|
config.name ??= getDefaultProjectName(project);
|
|
115
|
-
if (config.projects?.length && config.root !== root)
|
|
114
|
+
if (config.projects?.length && config.root !== root) _utils__WEBPACK_IMPORTED_MODULE_2__.vF.warn(`Projects cannot have nested projects, the "projects" field in project "${config.name}" will be ignored.`);
|
|
116
115
|
return {
|
|
117
116
|
config,
|
|
118
117
|
configFilePath
|
|
119
118
|
};
|
|
120
|
-
})).then((projects)=>(0,
|
|
119
|
+
})).then((projects)=>(0, _utils__WEBPACK_IMPORTED_MODULE_2__.zz)(projects.concat(projectConfigs), options));
|
|
121
120
|
if (!projects.length) {
|
|
122
121
|
let errorMsg = `No projects found, please make sure you have at least one valid project.
|
|
123
|
-
${
|
|
124
|
-
if (options.project) errorMsg += `\n${
|
|
122
|
+
${_utils__WEBPACK_IMPORTED_MODULE_2__.yW.gray('projects:')} ${JSON.stringify(config.projects, null, 2)}`;
|
|
123
|
+
if (options.project) errorMsg += `\n${_utils__WEBPACK_IMPORTED_MODULE_2__.yW.gray('projectName filter:')} ${JSON.stringify(options.project, null, 2)}`;
|
|
125
124
|
throw errorMsg;
|
|
126
125
|
}
|
|
127
126
|
const names = new Set();
|
|
@@ -139,7 +138,7 @@ ${conflictProjects.map((p)=>`- ${p.configFilePath || p.config.root}`).join('\n')
|
|
|
139
138
|
}
|
|
140
139
|
async function initCli(options) {
|
|
141
140
|
const cwd = process.cwd();
|
|
142
|
-
const root = options.root ? (0,
|
|
141
|
+
const root = options.root ? (0, _utils__WEBPACK_IMPORTED_MODULE_2__.FI)(cwd, options.root) : cwd;
|
|
143
142
|
const { config, configFilePath } = await resolveConfig({
|
|
144
143
|
...options,
|
|
145
144
|
root
|
package/dist/0~33.js
CHANGED
|
@@ -161,7 +161,7 @@ export const __webpack_modules__ = {
|
|
|
161
161
|
const { include, exclude, includeSource, root } = projects.find((p)=>p.environmentName === name).normalizedConfig;
|
|
162
162
|
const entries = await (0, utils.tG)({
|
|
163
163
|
include,
|
|
164
|
-
exclude,
|
|
164
|
+
exclude: exclude.patterns,
|
|
165
165
|
includeSource,
|
|
166
166
|
rootPath,
|
|
167
167
|
projectRoot: root,
|
|
@@ -261,7 +261,7 @@ export const __webpack_modules__ = {
|
|
|
261
261
|
utils.vF.log(utils.yW.gray('project:'), p.name);
|
|
262
262
|
}
|
|
263
263
|
utils.vF.log(utils.yW.gray('include:'), p.normalizedConfig.include.join(utils.yW.gray(', ')));
|
|
264
|
-
utils.vF.log(utils.yW.gray('exclude:'), p.normalizedConfig.exclude.join(utils.yW.gray(', ')));
|
|
264
|
+
utils.vF.log(utils.yW.gray('exclude:'), p.normalizedConfig.exclude.patterns.join(utils.yW.gray(', ')));
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
267
|
}
|
|
@@ -274,22 +274,9 @@ export const __webpack_modules__ = {
|
|
|
274
274
|
getSourcemap: (name)=>sourceMaps[name] || null,
|
|
275
275
|
filterRerunTestPaths: currentEntries.length ? currentEntries.map((e)=>e.testPath) : void 0
|
|
276
276
|
});
|
|
277
|
-
if (coverageProvider)
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
await coverageProvider.generateReports(finalCoverageMap, context.normalizedConfig.coverage);
|
|
281
|
-
if (context.normalizedConfig.coverage.thresholds) {
|
|
282
|
-
const { checkThresholds } = await __webpack_require__.e("691").then(__webpack_require__.bind(__webpack_require__, "./src/coverage/checkThresholds.ts"));
|
|
283
|
-
const thresholdResult = checkThresholds(finalCoverageMap, context.normalizedConfig.coverage.thresholds);
|
|
284
|
-
if (!thresholdResult.success) {
|
|
285
|
-
process.exitCode = 1;
|
|
286
|
-
utils.vF.log('');
|
|
287
|
-
utils.vF.log(thresholdResult.message);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
coverageProvider.cleanup();
|
|
291
|
-
} catch (error) {
|
|
292
|
-
utils.vF.error('Failed to generate coverage reports:', error);
|
|
277
|
+
if (coverageProvider) {
|
|
278
|
+
const { generateCoverage } = await __webpack_require__.e("204").then(__webpack_require__.bind(__webpack_require__, "./src/coverage/generate.ts"));
|
|
279
|
+
await generateCoverage(context, results, coverageProvider);
|
|
293
280
|
}
|
|
294
281
|
};
|
|
295
282
|
if ('watch' === command) {
|
|
@@ -393,6 +380,7 @@ export const __webpack_modules__ = {
|
|
|
393
380
|
});
|
|
394
381
|
var node_module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("node:module");
|
|
395
382
|
var node_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("node:url");
|
|
383
|
+
var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/utils/index.ts");
|
|
396
384
|
const CoverageProviderMap = {
|
|
397
385
|
istanbul: '@rstest/coverage-istanbul'
|
|
398
386
|
};
|
|
@@ -412,8 +400,10 @@ export const __webpack_modules__ = {
|
|
|
412
400
|
pluginCoverage,
|
|
413
401
|
CoverageProvider
|
|
414
402
|
};
|
|
415
|
-
} catch
|
|
416
|
-
|
|
403
|
+
} catch {
|
|
404
|
+
const error = new Error(`Failed to load coverage provider module: ${_utils__WEBPACK_IMPORTED_MODULE_2__.yW.cyan(moduleName)} in ${_utils__WEBPACK_IMPORTED_MODULE_2__.yW.underline(root)}, please make sure it is installed.\n`);
|
|
405
|
+
error.stack = '';
|
|
406
|
+
throw error;
|
|
417
407
|
}
|
|
418
408
|
};
|
|
419
409
|
async function createCoverageProvider(options, root) {
|
package/dist/0~493.js
CHANGED
|
@@ -2,7 +2,6 @@ import 'module';
|
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
3
|
import { AssertionError, strict } from "node:assert";
|
|
4
4
|
import { Console } from "node:console";
|
|
5
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_promises_153e37e0__ from "node:fs/promises";
|
|
6
5
|
export const __webpack_id__ = "493";
|
|
7
6
|
export const __webpack_ids__ = [
|
|
8
7
|
"493"
|
|
@@ -123,25 +122,5 @@ export const __webpack_modules__ = {
|
|
|
123
122
|
}
|
|
124
123
|
return new CustomConsole(process.stdout, process.stderr);
|
|
125
124
|
}
|
|
126
|
-
},
|
|
127
|
-
"./src/utils/index.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
128
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
129
|
-
fN: ()=>helper.fN,
|
|
130
|
-
Gv: ()=>helper.Gv,
|
|
131
|
-
kV: ()=>helper.kV,
|
|
132
|
-
q_: ()=>constants.q_,
|
|
133
|
-
bg: ()=>helper.bg,
|
|
134
|
-
yW: ()=>helper.yW
|
|
135
|
-
});
|
|
136
|
-
var constants = __webpack_require__("./src/utils/constants.ts");
|
|
137
|
-
var helper = __webpack_require__("./src/utils/helper.ts");
|
|
138
|
-
__webpack_require__("./src/utils/logger.ts");
|
|
139
|
-
__webpack_require__("node:fs");
|
|
140
|
-
__webpack_require__("node:fs/promises");
|
|
141
|
-
__webpack_require__("node:module");
|
|
142
|
-
__webpack_require__("pathe");
|
|
143
|
-
},
|
|
144
|
-
"node:fs/promises": function(module) {
|
|
145
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_node_fs_promises_153e37e0__;
|
|
146
125
|
}
|
|
147
126
|
};
|
package/dist/0~603.js
CHANGED
|
@@ -12,6 +12,7 @@ export const __webpack_modules__ = {
|
|
|
12
12
|
});
|
|
13
13
|
var node_module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("node:module");
|
|
14
14
|
var node_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("node:url");
|
|
15
|
+
var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/utils/index.ts");
|
|
15
16
|
const CoverageProviderMap = {
|
|
16
17
|
istanbul: '@rstest/coverage-istanbul'
|
|
17
18
|
};
|
|
@@ -31,8 +32,10 @@ export const __webpack_modules__ = {
|
|
|
31
32
|
pluginCoverage,
|
|
32
33
|
CoverageProvider
|
|
33
34
|
};
|
|
34
|
-
} catch
|
|
35
|
-
|
|
35
|
+
} catch {
|
|
36
|
+
const error = new Error(`Failed to load coverage provider module: ${_utils__WEBPACK_IMPORTED_MODULE_2__.yW.cyan(moduleName)} in ${_utils__WEBPACK_IMPORTED_MODULE_2__.yW.underline(root)}, please make sure it is installed.\n`);
|
|
37
|
+
error.stack = '';
|
|
38
|
+
throw error;
|
|
36
39
|
}
|
|
37
40
|
};
|
|
38
41
|
async function createCoverageProvider(options, root) {
|