@rstest/browser 0.11.5 → 0.11.7
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/css/index.43daaf6c93.css +1 -0
- package/dist/browser-container/container-static/js/260.3739fe815c.js +194 -0
- package/dist/browser-container/container-static/js/index.c0f87bfb3e.js +1 -0
- package/dist/browser-container/index.html +1 -1
- package/dist/browserExecutor.d.ts +7 -5
- package/dist/browserRsbuild.d.ts +139 -0
- package/dist/browserV8Coverage.d.ts +15 -0
- package/dist/client/240~1.js +150 -0
- package/dist/{augmentExpect.d.ts → client/client/augmentExpect.d.ts} +1 -1
- package/dist/client/{browserRpc.d.ts → client/browserRpc.d.ts} +1 -1
- package/dist/client/{dispatchTransport.d.ts → client/dispatchTransport.d.ts} +8 -4
- package/dist/client/client/index.d.ts +2 -0
- package/dist/client/client/runIdentity.d.ts +12 -0
- package/dist/client/client/runner.d.ts +4 -0
- package/dist/client/client/snapshot.d.ts +27 -0
- package/dist/client/client/sourceMapSupport.d.ts +36 -0
- package/dist/{browser.js → client/index.js} +3 -102
- package/dist/client/protocol.d.ts +225 -0
- package/dist/client/rpcProtocol.d.ts +138 -0
- package/dist/client/runner.js +675 -0
- package/dist/client/sourceMap/sourceMapLoader.d.ts +25 -0
- package/dist/containerRpc.d.ts +60 -0
- package/dist/dispatchCapabilities.d.ts +1 -2
- package/dist/headedRunRegistry.d.ts +51 -0
- package/dist/headedScheduler.d.ts +58 -0
- package/dist/headlessScheduler.d.ts +38 -0
- package/dist/headlessTransport.d.ts +4 -2
- package/dist/hostController.d.ts +12 -47
- package/dist/hostPayloads.d.ts +24 -0
- package/dist/index.js +2019 -1516
- package/dist/protocol.d.ts +48 -8
- package/dist/providers/index.d.ts +21 -0
- package/dist/providers/playwright/v8Coverage.d.ts +2 -0
- package/dist/rpcProtocol.d.ts +1 -2
- package/dist/schedulerSeam.d.ts +42 -0
- package/dist/sourceMap/sourceMapLoader.d.ts +12 -1
- package/dist/watchRerunPlanner.d.ts +20 -4
- package/dist/watchRuntime.d.ts +21 -0
- package/dist/watchSignals.d.ts +29 -0
- package/package.json +12 -12
- package/dist/33.js +0 -7
- package/dist/browser-container/container-static/css/index.0521ff95b1.css +0 -1
- package/dist/browser-container/container-static/js/506.b2f920fa67.js +0 -194
- package/dist/browser-container/container-static/js/index.d27fd63f5e.js +0 -1
- package/dist/browser.d.ts +0 -2
- package/dist/headlessLatestRerunScheduler.d.ts +0 -18
- package/src/augmentExpect.ts +0 -62
- package/src/browser.ts +0 -3
- package/src/browserExecutor.ts +0 -140
- package/src/browserRpcRegistry.ts +0 -57
- package/src/client/api.ts +0 -213
- package/src/client/browserRpc.ts +0 -86
- package/src/client/dispatchTransport.ts +0 -240
- package/src/client/entry.ts +0 -807
- package/src/client/locator.ts +0 -448
- package/src/client/snapshot.ts +0 -113
- package/src/client/sourceMapSupport.ts +0 -159
- package/src/concurrency.ts +0 -65
- package/src/configValidation.ts +0 -263
- package/src/dispatchCapabilities.ts +0 -182
- package/src/dispatchRouter.ts +0 -82
- package/src/env.d.ts +0 -54
- package/src/headedSerialTaskQueue.ts +0 -23
- package/src/headlessLatestRerunScheduler.ts +0 -76
- package/src/headlessTransport.ts +0 -28
- package/src/hostController.ts +0 -4633
- package/src/index.ts +0 -51
- package/src/manifest.d.ts +0 -41
- package/src/protocol.ts +0 -225
- package/src/providers/index.ts +0 -126
- package/src/providers/playwright/compileLocator.ts +0 -130
- package/src/providers/playwright/dispatchBrowserRpc.ts +0 -372
- package/src/providers/playwright/expectUtils.ts +0 -57
- package/src/providers/playwright/implementation.ts +0 -35
- package/src/providers/playwright/index.ts +0 -1
- package/src/providers/playwright/runtime.ts +0 -159
- package/src/providers/playwright/textMatcher.ts +0 -10
- package/src/rpcProtocol.ts +0 -218
- package/src/runSession.ts +0 -110
- package/src/sessionRegistry.ts +0 -89
- package/src/sourceMap/sourceMapLoader.ts +0 -96
- package/src/viewportPresets.ts +0 -69
- package/src/watchRerunPlanner.ts +0 -77
- /package/dist/{rslib-runtime.js → 612~0.js} +0 -0
- /package/dist/client/{api.d.ts → client/api.d.ts} +0 -0
- /package/dist/client/{locator.d.ts → client/locator.d.ts} +0 -0
|
@@ -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
|
-
};
|
package/src/headlessTransport.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
BrowserClientMessage,
|
|
3
|
-
BrowserDispatchRequest,
|
|
4
|
-
BrowserDispatchResponse,
|
|
5
|
-
} from './protocol';
|
|
6
|
-
import { DISPATCH_MESSAGE_TYPE, DISPATCH_RPC_BRIDGE_NAME } from './protocol';
|
|
7
|
-
import type { BrowserProviderPage } from './providers';
|
|
8
|
-
|
|
9
|
-
type HeadlessRunnerTransportHandlers = {
|
|
10
|
-
onDispatchMessage: (message: BrowserClientMessage) => Promise<void>;
|
|
11
|
-
onDispatchRpc: (
|
|
12
|
-
request: BrowserDispatchRequest,
|
|
13
|
-
) => Promise<BrowserDispatchResponse>;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Headless transport adapter.
|
|
18
|
-
* This only binds page bridge functions and delegates all scheduling decisions upstream.
|
|
19
|
-
*/
|
|
20
|
-
export const attachHeadlessRunnerTransport = async (
|
|
21
|
-
page: BrowserProviderPage,
|
|
22
|
-
handlers: HeadlessRunnerTransportHandlers,
|
|
23
|
-
): Promise<void> => {
|
|
24
|
-
// Fire-and-forget runner lifecycle messages (ready/log/result/fatal).
|
|
25
|
-
await page.exposeFunction(DISPATCH_MESSAGE_TYPE, handlers.onDispatchMessage);
|
|
26
|
-
// Request/response RPC bridge shared by snapshot and future namespaces.
|
|
27
|
-
await page.exposeFunction(DISPATCH_RPC_BRIDGE_NAME, handlers.onDispatchRpc);
|
|
28
|
-
};
|