@rstest/core 0.6.1 → 0.6.3
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 +0 -14
- package/dist/0~171.js +4 -6
- package/dist/0~204.js +67 -77
- package/dist/0~263.js +1423 -0
- package/dist/0~350.js +29 -373
- package/dist/0~365.js +92 -0
- package/dist/0~463.js +331 -0
- package/dist/0~470.js +388 -0
- package/dist/0~607.js +119 -0
- package/dist/0~691.js +74 -82
- package/dist/0~711.js +29 -373
- package/dist/0~764.js +13284 -0
- package/dist/0~814.js +900 -0
- package/dist/0~830.js +1130 -0
- package/dist/0~836.js +13 -21
- package/dist/0~971.js +130 -136
- package/dist/597.js +174 -0
- package/dist/603.js +41 -0
- package/dist/808.js +167 -0
- package/dist/857.js +3252 -0
- package/dist/index.js +2394 -5972
- package/dist/rslib-runtime.js +60 -0
- package/dist/worker.js +154 -1393
- package/dist-types/index.d.ts +24 -3
- package/dist-types/worker.d.ts +8 -2
- package/package.json +2 -2
- package/dist/0~33.js +0 -425
- package/dist/0~414.js +0 -16
- package/dist/0~493.js +0 -126
- package/dist/0~603.js +0 -50
- package/dist/0~628.js +0 -1090
- package/dist/0~655.js +0 -11533
- package/dist/0~85.js +0 -1819
- package/dist/0~873.js +0 -1220
- package/dist/0~928.js +0 -1432
- package/dist/0~967.js +0 -99
- /package/dist/{0~928.js.LICENSE.txt → 0~263.js.LICENSE.txt} +0 -0
- /package/dist/{0~655.js.LICENSE.txt → 0~764.js.LICENSE.txt} +0 -0
package/LICENSE.md
CHANGED
|
@@ -666,20 +666,6 @@ Licensed under MIT license in the repository at chalk/ansi-styles.
|
|
|
666
666
|
>
|
|
667
667
|
> 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.
|
|
668
668
|
|
|
669
|
-
### ansi-styles
|
|
670
|
-
|
|
671
|
-
Licensed under MIT license in the repository at chalk/ansi-styles.
|
|
672
|
-
|
|
673
|
-
> MIT License
|
|
674
|
-
>
|
|
675
|
-
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
676
|
-
>
|
|
677
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
678
|
-
>
|
|
679
|
-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
680
|
-
>
|
|
681
|
-
> 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.
|
|
682
|
-
|
|
683
669
|
### birpc
|
|
684
670
|
|
|
685
671
|
Licensed under MIT license in the repository at git+https://github.com/antfu-collective/birpc.git.
|
package/dist/0~171.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
];
|
|
7
|
-
export const __webpack_modules__ = {
|
|
3
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
|
+
import "./857.js";
|
|
5
|
+
__webpack_require__.add({
|
|
8
6
|
"../../node_modules/.pnpm/js-tokens@4.0.0/node_modules/js-tokens/index.js": function(__unused_webpack_module, exports) {
|
|
9
7
|
Object.defineProperty(exports, "__esModule", {
|
|
10
8
|
value: true
|
|
@@ -1309,4 +1307,4 @@ export const __webpack_modules__ = {
|
|
|
1309
1307
|
return keywords.has(word);
|
|
1310
1308
|
}
|
|
1311
1309
|
}
|
|
1312
|
-
};
|
|
1310
|
+
});
|
package/dist/0~204.js
CHANGED
|
@@ -1,83 +1,73 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
}
|
|
3
|
+
import { isDynamicPattern, glob, normalize, src_logger } from "./857.js";
|
|
4
|
+
const getIncludedFiles = async (coverage, rootPath)=>{
|
|
5
|
+
const ignoredPatterns = coverage.exclude?.filter((item)=>isDynamicPattern(item) || item.startsWith(rootPath) || item.startsWith('./'));
|
|
6
|
+
const allFiles = await glob(coverage.include, {
|
|
7
|
+
cwd: rootPath,
|
|
8
|
+
absolute: true,
|
|
9
|
+
onlyFiles: true,
|
|
10
|
+
ignore: ignoredPatterns,
|
|
11
|
+
dot: true,
|
|
12
|
+
expandDirectories: false
|
|
13
|
+
});
|
|
14
|
+
if (ignoredPatterns?.length !== coverage.exclude?.length) {
|
|
15
|
+
const excludes = coverage.exclude.filter((item)=>!isDynamicPattern(item) && !item.startsWith(rootPath) && !item.startsWith('./'));
|
|
16
|
+
return allFiles.filter((file)=>!excludes.some((exclude)=>file.includes(exclude)));
|
|
17
|
+
}
|
|
18
|
+
return allFiles;
|
|
19
|
+
};
|
|
20
|
+
async function generateCoverage(context, results, coverageProvider) {
|
|
21
|
+
const { rootPath, normalizedConfig: { coverage }, projects } = context;
|
|
22
|
+
try {
|
|
23
|
+
const finalCoverageMap = coverageProvider.createCoverageMap();
|
|
24
|
+
for (const result of results)if (result.coverage) finalCoverageMap.merge(result.coverage);
|
|
25
|
+
if (coverage.include?.length) {
|
|
26
|
+
const coveredFiles = finalCoverageMap.files();
|
|
27
|
+
let isTimeout = false;
|
|
28
|
+
const timeoutId = setTimeout(()=>{
|
|
29
|
+
isTimeout = true;
|
|
30
|
+
src_logger.info('Generating coverage for untested files...');
|
|
31
|
+
}, 1000);
|
|
32
|
+
const allFiles = (await Promise.all(projects.map(async (p)=>{
|
|
33
|
+
const includedFiles = await getIncludedFiles(coverage, p.rootPath);
|
|
34
|
+
const uncoveredFiles = includedFiles.filter((file)=>!coveredFiles.includes(normalize(file)));
|
|
35
|
+
if (uncoveredFiles.length) await generateCoverageForUntestedFiles(p.environmentName, uncoveredFiles, finalCoverageMap, coverageProvider);
|
|
36
|
+
return includedFiles;
|
|
37
|
+
}))).flat();
|
|
38
|
+
clearTimeout(timeoutId);
|
|
39
|
+
if (isTimeout) src_logger.info('Coverage for untested files generated.');
|
|
40
|
+
finalCoverageMap.filter((file)=>allFiles.includes(normalize(file)));
|
|
71
41
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
42
|
+
await coverageProvider.generateReports(finalCoverageMap, coverage);
|
|
43
|
+
if (coverage.thresholds) {
|
|
44
|
+
const { checkThresholds } = await import("./0~691.js").then((mod)=>({
|
|
45
|
+
checkThresholds: mod.checkThresholds
|
|
46
|
+
}));
|
|
47
|
+
const thresholdResult = checkThresholds({
|
|
48
|
+
coverageMap: finalCoverageMap,
|
|
49
|
+
coverageProvider,
|
|
50
|
+
rootPath,
|
|
51
|
+
thresholds: coverage.thresholds
|
|
80
52
|
});
|
|
53
|
+
if (!thresholdResult.success) {
|
|
54
|
+
src_logger.log('');
|
|
55
|
+
src_logger.log(thresholdResult.message);
|
|
56
|
+
process.exitCode = 1;
|
|
57
|
+
}
|
|
81
58
|
}
|
|
59
|
+
} catch (error) {
|
|
60
|
+
src_logger.error('Failed to generate coverage reports:', error);
|
|
82
61
|
}
|
|
83
|
-
}
|
|
62
|
+
}
|
|
63
|
+
async function generateCoverageForUntestedFiles(environmentName, uncoveredFiles, coverageMap, coverageProvider) {
|
|
64
|
+
if (!coverageProvider.generateCoverageForUntestedFiles) return void src_logger.warn('Current coverage provider does not support generating coverage for untested files.');
|
|
65
|
+
const coverages = await coverageProvider.generateCoverageForUntestedFiles({
|
|
66
|
+
environmentName,
|
|
67
|
+
files: uncoveredFiles
|
|
68
|
+
});
|
|
69
|
+
coverages.forEach((coverageData)=>{
|
|
70
|
+
coverageMap.addFileCoverage(coverageData);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
export { generateCoverage };
|