@rstest/core 0.9.4 → 0.9.5
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 -228
- package/dist/0~8843.js +23 -13
- package/dist/0~browserLoader.js +1 -1
- package/dist/0~browser~1.js +4 -4
- package/dist/0~checkThresholds.js +1 -1
- package/dist/0~console.js +1 -1
- package/dist/0~fake-timers.js +1483 -0
- package/dist/0~generate.js +4 -3
- package/dist/0~happyDom.js +1 -1
- package/dist/0~jsdom.js +1 -1
- package/dist/0~listTests.js +3 -3
- package/dist/0~loadModule.js +1 -1
- package/dist/0~runTests.js +11 -4
- package/dist/0~snapshot.js +2140 -0
- package/dist/0~snapshot.js.LICENSE.txt +7 -0
- package/dist/0~utils.js +1 -1
- package/dist/1949.js +2919 -9808
- package/dist/1949.js.LICENSE.txt +1 -49
- package/dist/3145.js +318 -36
- package/dist/4411.js +232 -47
- package/dist/6830.js +61 -9
- package/dist/7552.js +22 -4918
- package/dist/9743.js +1982 -0
- package/dist/9784.js +1343 -0
- package/dist/{7552.js.LICENSE.txt → 9784.js.LICENSE.txt} +19 -8
- package/dist/browser-runtime/2~fake-timers.js +1653 -0
- package/dist/browser-runtime/2~snapshot.js +2138 -0
- package/dist/browser-runtime/2~snapshot.js.LICENSE.txt +7 -0
- package/dist/browser-runtime/723.js +2055 -10605
- package/dist/browser-runtime/723.js.LICENSE.txt +0 -17
- package/dist/browser-runtime/index.d.ts +189 -11
- package/dist/browser-runtime/rslib-runtime.js +0 -7
- package/dist/browser.d.ts +39 -5
- package/dist/browser.js +2 -2
- package/dist/globalSetupWorker.js +1 -1
- package/dist/index.d.ts +39 -5
- package/dist/mockRuntimeCode.js +2 -0
- package/dist/worker.d.ts +31 -5
- package/dist/worker.js +11 -9
- package/package.json +21 -22
package/dist/0~generate.js
CHANGED
|
@@ -27,7 +27,7 @@ async function generateCoverage(context, results, coverageProvider) {
|
|
|
27
27
|
return normalizedFile.startsWith(normalize(rootPath));
|
|
28
28
|
});
|
|
29
29
|
if (coverage.include?.length) {
|
|
30
|
-
const
|
|
30
|
+
const coveredFilesSet = new Set(finalCoverageMap.files().map(normalize));
|
|
31
31
|
let isTimeout = false;
|
|
32
32
|
const timeoutId = setTimeout(()=>{
|
|
33
33
|
isTimeout = true;
|
|
@@ -35,13 +35,14 @@ async function generateCoverage(context, results, coverageProvider) {
|
|
|
35
35
|
}, 1000);
|
|
36
36
|
const allFiles = (await Promise.all(projects.map(async (p)=>{
|
|
37
37
|
const includedFiles = await getIncludedFiles(coverage, p.rootPath);
|
|
38
|
-
const uncoveredFiles = includedFiles.filter((file)=>!
|
|
38
|
+
const uncoveredFiles = includedFiles.filter((file)=>!coveredFilesSet.has(normalize(file)));
|
|
39
39
|
if (uncoveredFiles.length) await generateCoverageForUntestedFiles(p.environmentName, uncoveredFiles, finalCoverageMap, coverageProvider);
|
|
40
40
|
return includedFiles;
|
|
41
41
|
}))).flat();
|
|
42
42
|
clearTimeout(timeoutId);
|
|
43
43
|
if (isTimeout) logger_logger.info('Coverage for untested files generated.');
|
|
44
|
-
|
|
44
|
+
const allFilesSet = new Set(allFiles.map(normalize));
|
|
45
|
+
finalCoverageMap.filter((file)=>allFilesSet.has(normalize(file)));
|
|
45
46
|
}
|
|
46
47
|
await coverageProvider.generateReports(finalCoverageMap, coverage);
|
|
47
48
|
if (coverage.thresholds) {
|
package/dist/0~happyDom.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import { checkPkgInstalled } from "./7552.js";
|
|
3
2
|
import { installGlobal, addDefaultErrorHandler } from "./0~utils.js";
|
|
3
|
+
import { checkPkgInstalled } from "./7552.js";
|
|
4
4
|
const environment = {
|
|
5
5
|
name: 'happy-dom',
|
|
6
6
|
setup: async (global, options = {})=>{
|
package/dist/0~jsdom.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import { checkPkgInstalled } from "./7552.js";
|
|
3
2
|
import { installGlobal, addDefaultErrorHandler } from "./0~utils.js";
|
|
3
|
+
import { checkPkgInstalled } from "./7552.js";
|
|
4
4
|
const environment = {
|
|
5
5
|
name: 'jsdom',
|
|
6
6
|
setup: async (global, options)=>{
|
package/dist/0~listTests.js
CHANGED
|
@@ -2,8 +2,8 @@ import "node:module";
|
|
|
2
2
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { dirname, isAbsolute, join, relative } from "node:path";
|
|
4
4
|
import { prepareRsbuild, createPool, createRsbuildServer, runGlobalTeardown, runGlobalSetup } from "./0~8843.js";
|
|
5
|
-
import {
|
|
6
|
-
import { logger as logger_logger,
|
|
5
|
+
import { resolveShardedEntries, getTestEntries, prettyTestPath } from "./4411.js";
|
|
6
|
+
import { getTaskNameWithPrefix, logger as logger_logger, color as logger_color, ROOT_SUITE_NAME, bgColor } from "./6830.js";
|
|
7
7
|
const collectNodeTests = async ({ context, nodeProjects, globTestSourceEntries })=>{
|
|
8
8
|
const { getSetupFiles } = await import("./255.js");
|
|
9
9
|
if (0 === nodeProjects.length) return {
|
|
@@ -25,7 +25,7 @@ const collectNodeTests = async ({ context, nodeProjects, globTestSourceEntries }
|
|
|
25
25
|
getSetupFiles(globalSetup, rootPath)
|
|
26
26
|
];
|
|
27
27
|
}));
|
|
28
|
-
const rsbuildInstance = await prepareRsbuild(context, globTestSourceEntries, setupFiles, globalSetupFiles);
|
|
28
|
+
const rsbuildInstance = await prepareRsbuild(context, globTestSourceEntries, setupFiles, globalSetupFiles, nodeProjects);
|
|
29
29
|
const { getRsbuildStats, closeServer } = await createRsbuildServer({
|
|
30
30
|
globTestSourceEntries,
|
|
31
31
|
globalSetupFiles,
|
package/dist/0~loadModule.js
CHANGED
package/dist/0~runTests.js
CHANGED
|
@@ -212,9 +212,16 @@ async function runTests(context) {
|
|
|
212
212
|
};
|
|
213
213
|
let browserProjectsToRun = browserProjects;
|
|
214
214
|
let nodeProjectsToRun = nodeProjects;
|
|
215
|
-
if (
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
if (isWatchMode) {
|
|
216
|
+
if (shard) {
|
|
217
|
+
browserProjectsToRun = browserProjects.filter((p)=>Object.keys(entriesCache.get(p.environmentName)?.entries || {}).length > 0);
|
|
218
|
+
nodeProjectsToRun = nodeProjects.filter((p)=>Object.keys(entriesCache.get(p.environmentName)?.entries || {}).length > 0);
|
|
219
|
+
}
|
|
220
|
+
} else {
|
|
221
|
+
await Promise.all(allProjects.map((p)=>globTestSourceEntries(p.environmentName)));
|
|
222
|
+
const hasEntries = (env)=>Object.keys(entriesCache.get(env)?.entries || {}).length > 0;
|
|
223
|
+
browserProjectsToRun = browserProjects.filter((p)=>hasEntries(p.environmentName));
|
|
224
|
+
nodeProjectsToRun = nodeProjects.filter((p)=>hasEntries(p.environmentName));
|
|
218
225
|
}
|
|
219
226
|
const hasBrowserTestsToRun = browserProjectsToRun.length > 0;
|
|
220
227
|
const hasNodeTestsToRun = nodeProjectsToRun.length > 0;
|
|
@@ -248,7 +255,7 @@ async function runTests(context) {
|
|
|
248
255
|
getSetupFiles(globalSetup, rootPath)
|
|
249
256
|
];
|
|
250
257
|
}));
|
|
251
|
-
const rsbuildInstance = await prepareRsbuild(context, globTestSourceEntries, setupFiles, globalSetupFiles);
|
|
258
|
+
const rsbuildInstance = await prepareRsbuild(context, globTestSourceEntries, setupFiles, globalSetupFiles, projects);
|
|
252
259
|
const { getRsbuildStats, closeServer } = await createRsbuildServer({
|
|
253
260
|
inspectedConfig: {
|
|
254
261
|
...context.normalizedConfig,
|