@rstest/browser 0.11.4 → 0.11.6
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/dist/browser-container/container-static/js/683.4f821ce8f1.js +194 -0
- package/dist/browser-container/container-static/js/index.568aa7cb35.js +1 -0
- package/dist/browser-container/container-static/js/lib-react.e24a1d366b.js +2 -0
- package/dist/browser-container/index.html +1 -1
- package/dist/browserExecutor.d.ts +7 -5
- package/dist/browserRsbuild.d.ts +119 -0
- package/dist/containerRpc.d.ts +52 -0
- package/dist/dispatchCapabilities.d.ts +1 -2
- package/dist/headedScheduler.d.ts +58 -0
- package/dist/headlessScheduler.d.ts +37 -0
- package/dist/hostController.d.ts +12 -47
- package/dist/hostPayloads.d.ts +30 -0
- package/dist/index.js +1738 -1793
- package/dist/protocol.d.ts +5 -0
- package/dist/schedulerSeam.d.ts +37 -0
- package/dist/watchRerunPlanner.d.ts +5 -0
- package/dist/watchRuntime.d.ts +21 -0
- package/dist/watchSignals.d.ts +22 -0
- package/package.json +5 -5
- package/src/browserExecutor.ts +90 -8
- package/src/browserRsbuild.ts +1927 -0
- package/src/client/entry.ts +3 -0
- package/src/containerRpc.ts +206 -0
- package/src/dispatchCapabilities.ts +1 -6
- package/src/headedScheduler.ts +664 -0
- package/src/headlessScheduler.ts +566 -0
- package/src/hostController.ts +855 -4163
- package/src/hostPayloads.ts +62 -0
- package/src/protocol.ts +6 -0
- package/src/schedulerSeam.ts +49 -0
- package/src/watchRerunPlanner.ts +18 -7
- package/src/watchRuntime.ts +83 -0
- package/src/watchSignals.ts +93 -0
- package/dist/browser-container/container-static/js/243.a8eed2b9e7.js +0 -27406
- package/dist/browser-container/container-static/js/243.a8eed2b9e7.js.LICENSE.txt +0 -1
- package/dist/browser-container/container-static/js/index.84aaafaf21.js +0 -3058
- package/dist/browser-container/container-static/js/lib-react.62b27a21db.js +0 -8454
- package/dist/browser-container/container-static/js/lib-react.62b27a21db.js.LICENSE.txt +0 -1
- package/dist/headlessLatestRerunScheduler.d.ts +0 -18
- package/src/headlessLatestRerunScheduler.ts +0 -76
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! LICENSE: lib-react.62b27a21db.js.LICENSE.txt */
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
type HeadlessLatestRerunScheduler<TFile> = {
|
|
2
|
-
enqueueLatest: (files: TFile[]) => Promise<void>;
|
|
3
|
-
whenIdle: () => Promise<void>;
|
|
4
|
-
};
|
|
5
|
-
type HeadlessLatestRerunSchedulerOptions<TFile, TRun> = {
|
|
6
|
-
getActiveRun: () => TRun | null;
|
|
7
|
-
isRunCancelled: (run: TRun) => boolean;
|
|
8
|
-
invalidateActiveRun: () => void;
|
|
9
|
-
interruptActiveRun: (run: TRun) => Promise<void>;
|
|
10
|
-
runFiles: (files: TFile[]) => Promise<void>;
|
|
11
|
-
onError?: (error: unknown) => Promise<void> | void;
|
|
12
|
-
onInterrupt?: (run: TRun) => void;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Latest-only rerun scheduler for headless watch mode.
|
|
16
|
-
* Keeps only the newest pending payload and interrupts active run generations.
|
|
17
|
-
*/ export declare const createHeadlessLatestRerunScheduler: <TFile, TRun>(options: HeadlessLatestRerunSchedulerOptions<TFile, TRun>) => HeadlessLatestRerunScheduler<TFile>;
|
|
18
|
-
export { };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
type HeadlessLatestRerunScheduler<TFile> = {
|
|
2
|
-
enqueueLatest: (files: TFile[]) => Promise<void>;
|
|
3
|
-
whenIdle: () => Promise<void>;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
type HeadlessLatestRerunSchedulerOptions<TFile, TRun> = {
|
|
7
|
-
getActiveRun: () => TRun | null;
|
|
8
|
-
isRunCancelled: (run: TRun) => boolean;
|
|
9
|
-
invalidateActiveRun: () => void;
|
|
10
|
-
interruptActiveRun: (run: TRun) => Promise<void>;
|
|
11
|
-
runFiles: (files: TFile[]) => Promise<void>;
|
|
12
|
-
onError?: (error: unknown) => Promise<void> | void;
|
|
13
|
-
onInterrupt?: (run: TRun) => void;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Latest-only rerun scheduler for headless watch mode.
|
|
18
|
-
* Keeps only the newest pending payload and interrupts active run generations.
|
|
19
|
-
*/
|
|
20
|
-
export const createHeadlessLatestRerunScheduler = <TFile, TRun>(
|
|
21
|
-
options: HeadlessLatestRerunSchedulerOptions<TFile, TRun>,
|
|
22
|
-
): HeadlessLatestRerunScheduler<TFile> => {
|
|
23
|
-
let pendingFiles: TFile[] | null = null;
|
|
24
|
-
let draining: Promise<void> | null = null;
|
|
25
|
-
let latestEnqueueVersion = 0;
|
|
26
|
-
|
|
27
|
-
const runDrainLoop = async (): Promise<void> => {
|
|
28
|
-
while (pendingFiles) {
|
|
29
|
-
const nextFiles = pendingFiles;
|
|
30
|
-
pendingFiles = null;
|
|
31
|
-
|
|
32
|
-
try {
|
|
33
|
-
await options.runFiles(nextFiles);
|
|
34
|
-
} catch (error) {
|
|
35
|
-
try {
|
|
36
|
-
await options.onError?.(error);
|
|
37
|
-
} catch {
|
|
38
|
-
// Keep draining even if error reporting fails.
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const ensureDrainLoop = (): void => {
|
|
45
|
-
if (draining) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
draining = runDrainLoop().finally(() => {
|
|
50
|
-
draining = null;
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
return {
|
|
55
|
-
async enqueueLatest(files: TFile[]): Promise<void> {
|
|
56
|
-
const enqueueVersion = ++latestEnqueueVersion;
|
|
57
|
-
const activeRun = options.getActiveRun();
|
|
58
|
-
if (activeRun && !options.isRunCancelled(activeRun)) {
|
|
59
|
-
options.onInterrupt?.(activeRun);
|
|
60
|
-
options.invalidateActiveRun();
|
|
61
|
-
await options.interruptActiveRun(activeRun);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// If a newer enqueue arrived while interrupting, drop this stale payload.
|
|
65
|
-
if (enqueueVersion !== latestEnqueueVersion) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
pendingFiles = files;
|
|
70
|
-
ensureDrainLoop();
|
|
71
|
-
},
|
|
72
|
-
async whenIdle(): Promise<void> {
|
|
73
|
-
await draining;
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
};
|