@rstest/browser 0.10.3 → 0.10.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.
Files changed (64) hide show
  1. package/dist/626.js +2 -1
  2. package/dist/browser-container/container-static/css/index.0521ff95b1.css +1 -0
  3. package/dist/browser-container/container-static/js/{27.099feaf1da.js → 854.c59f71483d.js} +5728 -5756
  4. package/dist/browser-container/container-static/js/854.c59f71483d.js.LICENSE.txt +1 -0
  5. package/dist/browser-container/container-static/js/{index.be8c8d2626.js → index.fedc31dff3.js} +109 -136
  6. package/dist/browser-container/container-static/js/{lib-react.5ae9b90ee5.js → lib-react.62b27a21db.js} +21 -21
  7. package/dist/browser-container/container-static/js/lib-react.62b27a21db.js.LICENSE.txt +1 -0
  8. package/dist/browser-container/index.html +1 -1
  9. package/dist/browser.js +4 -4
  10. package/dist/browserRpcRegistry.d.ts +1 -2
  11. package/dist/client/api.d.ts +1 -1
  12. package/dist/client/dispatchTransport.d.ts +18 -1
  13. package/dist/client/locator.d.ts +2 -3
  14. package/dist/concurrency.d.ts +5 -3
  15. package/dist/configValidation.d.ts +2 -2
  16. package/dist/dispatchCapabilities.d.ts +3 -3
  17. package/dist/dispatchRouter.d.ts +2 -3
  18. package/dist/headedSerialTaskQueue.d.ts +5 -5
  19. package/dist/headlessLatestRerunScheduler.d.ts +2 -3
  20. package/dist/headlessTransport.d.ts +2 -3
  21. package/dist/hostController.d.ts +12 -9
  22. package/dist/index.d.ts +6 -6
  23. package/dist/index.js +169 -216
  24. package/dist/protocol.d.ts +78 -55
  25. package/dist/providers/index.d.ts +18 -20
  26. package/dist/providers/playwright/dispatchBrowserRpc.d.ts +5 -3
  27. package/dist/providers/playwright/expectUtils.d.ts +2 -3
  28. package/dist/providers/playwright/implementation.d.ts +1 -1
  29. package/dist/providers/playwright/runtime.d.ts +1 -1
  30. package/dist/rpcProtocol.d.ts +36 -29
  31. package/dist/runSession.d.ts +3 -5
  32. package/dist/sessionRegistry.d.ts +2 -3
  33. package/dist/sourceMap/sourceMapLoader.d.ts +2 -2
  34. package/dist/viewportPresets.d.ts +7 -3
  35. package/dist/watchCliShortcuts.d.ts +1 -1
  36. package/dist/watchRerunPlanner.d.ts +2 -2
  37. package/package.json +7 -9
  38. package/src/AGENTS.md +7 -1
  39. package/src/browserRpcRegistry.ts +2 -2
  40. package/src/client/dispatchTransport.ts +63 -1
  41. package/src/client/entry.ts +25 -58
  42. package/src/client/public.ts +3 -3
  43. package/src/client/snapshot.ts +24 -22
  44. package/src/client/sourceMapSupport.ts +1 -1
  45. package/src/concurrency.ts +7 -21
  46. package/src/configValidation.ts +2 -2
  47. package/src/dispatchCapabilities.ts +102 -83
  48. package/src/env.d.ts +6 -2
  49. package/src/headedSerialTaskQueue.ts +5 -1
  50. package/src/hostController.ts +85 -43
  51. package/src/index.ts +22 -11
  52. package/src/protocol.ts +66 -22
  53. package/src/providers/index.ts +8 -1
  54. package/src/rpcProtocol.ts +34 -21
  55. package/src/viewportPresets.ts +5 -0
  56. package/src/watchCliShortcuts.ts +2 -4
  57. package/dist/browser-container/container-static/css/index.5c72297783.css +0 -1
  58. package/dist/browser-container/container-static/js/27.099feaf1da.js.LICENSE.txt +0 -1
  59. package/dist/browser-container/container-static/js/lib-react.5ae9b90ee5.js.LICENSE.txt +0 -1
  60. package/dist/client/entry.d.ts +0 -4
  61. package/dist/client/fakeTimersStub.d.ts +0 -25
  62. package/dist/client/public.d.ts +0 -9
  63. package/dist/client/snapshot.d.ts +0 -29
  64. package/dist/client/sourceMapSupport.d.ts +0 -42
@@ -1,12 +1,12 @@
1
- /*! LICENSE: lib-react.5ae9b90ee5.js.LICENSE.txt */
2
- /*! LICENSE: lib-react.5ae9b90ee5.js.LICENSE.txt */ "use strict";
1
+ /*! LICENSE: lib-react.62b27a21db.js.LICENSE.txt */
2
+ /*! LICENSE: lib-react.62b27a21db.js.LICENSE.txt */ "use strict";
3
3
  (self.rspackChunk_rstest_browser_ui = self.rspackChunk_rstest_browser_ui || []).push([
4
4
  [
5
5
  783
6
6
  ],
7
7
  {
8
- 1044 (e, t, n) {
9
- var r, l = n(1099), a = n(7348), o = n(5542);
8
+ 4482 (e, t, n) {
9
+ var r, l = n(1099), a = n(405), o = n(7868);
10
10
  function i(e) {
11
11
  var t = "https://react.dev/errors/" + e;
12
12
  if (1 < arguments.length) {
@@ -7719,7 +7719,7 @@
7719
7719
  }
7720
7720
  };
7721
7721
  var cA = a.version;
7722
- if ("19.2.6" !== cA) throw Error(i(527, cA, "19.2.6"));
7722
+ if ("19.2.7" !== cA) throw Error(i(527, cA, "19.2.7"));
7723
7723
  if (D.findDOMNode = function(e) {
7724
7724
  var t = e._reactInternals;
7725
7725
  if (void 0 === t) {
@@ -7797,10 +7797,10 @@
7797
7797
  if (!cM.isDisabled && cM.supportsFiber) try {
7798
7798
  ed = cM.inject({
7799
7799
  bundleType: 0,
7800
- version: "19.2.6",
7800
+ version: "19.2.7",
7801
7801
  rendererPackageName: "react-dom",
7802
7802
  currentDispatcherRef: O,
7803
- reconcilerVersion: "19.2.6"
7803
+ reconcilerVersion: "19.2.7"
7804
7804
  }), ep = cM;
7805
7805
  } catch (e) {}
7806
7806
  }
@@ -7814,8 +7814,8 @@
7814
7814
  }, lS(o), t = r, e[eM] = t.current, u7(e), new cF(t);
7815
7815
  };
7816
7816
  },
7817
- 1816 (e, t, n) {
7818
- var r = n(7348);
7817
+ 2826 (e, t, n) {
7818
+ var r = n(405);
7819
7819
  function l(e) {
7820
7820
  var t = "https://react.dev/errors/" + e;
7821
7821
  if (1 < arguments.length) {
@@ -7926,27 +7926,27 @@
7926
7926
  return u.H.useFormState(e, t, n);
7927
7927
  }, t.useFormStatus = function() {
7928
7928
  return u.H.useHostTransitionStatus();
7929
- }, t.version = "19.2.6";
7929
+ }, t.version = "19.2.7";
7930
7930
  },
7931
- 2303 (e, t, n) {
7931
+ 7541 (e, t, n) {
7932
7932
  (function e() {
7933
7933
  if ("u" > typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE) try {
7934
7934
  __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e);
7935
7935
  } catch (e) {
7936
7936
  console.error(e);
7937
7937
  }
7938
- })(), e.exports = n(1044);
7938
+ })(), e.exports = n(4482);
7939
7939
  },
7940
- 5542 (e, t, n) {
7940
+ 7868 (e, t, n) {
7941
7941
  (function e() {
7942
7942
  if ("u" > typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE) try {
7943
7943
  __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e);
7944
7944
  } catch (e) {
7945
7945
  console.error(e);
7946
7946
  }
7947
- })(), e.exports = n(1816);
7947
+ })(), e.exports = n(2826);
7948
7948
  },
7949
- 810 (e, t) {
7949
+ 8881 (e, t) {
7950
7950
  var n = Symbol.for("react.transitional.element");
7951
7951
  function r(e, t, r) {
7952
7952
  var l = null;
@@ -7962,7 +7962,7 @@
7962
7962
  }
7963
7963
  t.Fragment = Symbol.for("react.fragment"), t.jsx = r, t.jsxs = r;
7964
7964
  },
7965
- 6773 (e, t) {
7965
+ 7866 (e, t) {
7966
7966
  var n = Symbol.for("react.transitional.element"), r = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), i = Symbol.for("react.consumer"), u = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), f = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), p = Symbol.for("react.activity"), m = Symbol.iterator, h = {
7967
7967
  isMounted: function() {
7968
7968
  return !1;
@@ -8240,13 +8240,13 @@
8240
8240
  return E.H.useSyncExternalStore(e, t, n);
8241
8241
  }, t.useTransition = function() {
8242
8242
  return E.H.useTransition();
8243
- }, t.version = "19.2.6";
8243
+ }, t.version = "19.2.7";
8244
8244
  },
8245
- 7348 (e, t, n) {
8246
- e.exports = n(6773);
8245
+ 405 (e, t, n) {
8246
+ e.exports = n(7866);
8247
8247
  },
8248
- 7080 (e, t, n) {
8249
- e.exports = n(810);
8248
+ 9793 (e, t, n) {
8249
+ e.exports = n(8881);
8250
8250
  },
8251
8251
  7146 (e, t) {
8252
8252
  function n(e, t) {
@@ -0,0 +1 @@
1
+ /*! LICENSE: lib-react.62b27a21db.js.LICENSE.txt */
@@ -12,7 +12,7 @@
12
12
  <script>
13
13
  window.__RSTEST_BROWSER_OPTIONS__ = __RSTEST_OPTIONS_PLACEHOLDER__;
14
14
  </script>
15
- <script defer src="/container-static/js/lib-react.5ae9b90ee5.js"></script><script defer src="/container-static/js/27.099feaf1da.js"></script><script defer src="/container-static/js/index.be8c8d2626.js"></script><link href="/container-static/css/index.5c72297783.css" rel="stylesheet"></head>
15
+ <script defer src="/container-static/js/lib-react.62b27a21db.js"></script><script defer src="/container-static/js/854.c59f71483d.js"></script><script defer src="/container-static/js/index.fedc31dff3.js"></script><link href="/container-static/css/index.0521ff95b1.css" rel="stylesheet"></head>
16
16
  <body>
17
17
  <div id="root"></div>
18
18
  </body>
package/dist/browser.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DISPATCH_RESPONSE_TYPE, DISPATCH_RPC_REQUEST_TYPE, DISPATCH_MESSAGE_TYPE, DISPATCH_NAMESPACE_BROWSER } from "./626.js";
1
+ import { DISPATCH_RESPONSE_TYPE, DISPATCH_RPC_BRIDGE_NAME as protocol_DISPATCH_RPC_BRIDGE_NAME, DISPATCH_RPC_REQUEST_TYPE as protocol_DISPATCH_RPC_REQUEST_TYPE, DISPATCH_MESSAGE_TYPE as protocol_DISPATCH_MESSAGE_TYPE, DISPATCH_NAMESPACE_BROWSER } from "./626.js";
2
2
  const DEFAULT_RPC_TIMEOUT_MS = 30000;
3
3
  const getRpcTimeout = ()=>window.__RSTEST_BROWSER_OPTIONS__?.rpcTimeout ?? DEFAULT_RPC_TIMEOUT_MS;
4
4
  const pendingRequests = new Map();
@@ -34,7 +34,7 @@ const unwrapDispatchBridgeResult = (requestId, result, staleMessage)=>{
34
34
  };
35
35
  const dispatchRpc = ({ requestId, request, timeoutMs, timeoutMessage, staleMessage })=>{
36
36
  if (window.parent === window) {
37
- const dispatchBridge = window.__rstest_dispatch_rpc__;
37
+ const dispatchBridge = window[protocol_DISPATCH_RPC_BRIDGE_NAME];
38
38
  if (!dispatchBridge) throw new Error('Dispatch RPC bridge is not available in top-level runner.');
39
39
  return new Promise((resolve, reject)=>{
40
40
  const timeoutId = setTimeout(()=>{
@@ -68,9 +68,9 @@ const dispatchRpc = ({ requestId, request, timeoutMs, timeoutMessage, staleMessa
68
68
  }
69
69
  });
70
70
  window.parent.postMessage({
71
- type: DISPATCH_MESSAGE_TYPE,
71
+ type: protocol_DISPATCH_MESSAGE_TYPE,
72
72
  payload: {
73
- type: DISPATCH_RPC_REQUEST_TYPE,
73
+ type: protocol_DISPATCH_RPC_REQUEST_TYPE,
74
74
  payload: request
75
75
  }
76
76
  }, '*');
@@ -13,6 +13,5 @@
13
13
  * toHaveValues
14
14
  * - Artifacts intentionally excluded for now: screenshot/toMatchScreenshot/
15
15
  * trace/video
16
- */
17
- export declare const supportedLocatorActions: Set<string>;
16
+ */ export declare const supportedLocatorActions: Set<string>;
18
17
  export declare const supportedExpectElementMatchers: Set<string>;
@@ -1,3 +1,3 @@
1
1
  import { Locator, page, setTestIdAttribute } from './locator.js';
2
- export type { BrowserPage, BrowserSerializable, LocatorBlurOptions, LocatorCheckOptions, LocatorClickOptions, LocatorDblclickOptions, LocatorDispatchEventInit, LocatorFillOptions, LocatorFilterOptions, LocatorFocusOptions, LocatorGetByRoleOptions, LocatorHoverOptions, LocatorKeyboardModifier, LocatorMouseButton, LocatorPosition, LocatorPressOptions, LocatorScrollIntoViewIfNeededOptions, LocatorSelectOptionOptions, LocatorSetInputFilesOptions, LocatorTextOptions, LocatorWaitForOptions, } from './locator.js';
2
+ export type { BrowserPage, BrowserSerializable, LocatorBlurOptions, LocatorCheckOptions, LocatorClickOptions, LocatorDblclickOptions, LocatorDispatchEventInit, LocatorFillOptions, LocatorFilterOptions, LocatorFocusOptions, LocatorGetByRoleOptions, LocatorHoverOptions, LocatorKeyboardModifier, LocatorMouseButton, LocatorPosition, LocatorPressOptions, LocatorScrollIntoViewIfNeededOptions, LocatorSelectOptionOptions, LocatorSetInputFilesOptions, LocatorTextOptions, LocatorWaitForOptions } from './locator.js';
3
3
  export { Locator, page, setTestIdAttribute };
@@ -1,7 +1,24 @@
1
1
  import type { BrowserDispatchRequest } from '../protocol.js';
2
2
  export declare const getRpcTimeout: () => number;
3
3
  export declare const createRequestId: (prefix: string) => string;
4
- export declare const dispatchRpc: <T>({ requestId, request, timeoutMs, timeoutMessage, staleMessage, }: {
4
+ /**
5
+ * Build a runner-lifecycle dispatch request.
6
+ *
7
+ * Lifecycle events (`file-ready`, `suite-start`, `suite-result`, `case-start`)
8
+ * share the dispatch-rpc envelope but are delivered fire-and-forget via
9
+ * {@link sendRunnerLifecycle}, so the request id only needs to be unique — it is
10
+ * produced by the shared {@link createRequestId} factory rather than a bespoke
11
+ * per-runner counter.
12
+ */ export declare const createRunnerLifecycleRequest: (method: string, args: unknown) => BrowserDispatchRequest;
13
+ /**
14
+ * Deliver a runner-lifecycle request fire-and-forget.
15
+ *
16
+ * Unlike {@link dispatchRpc}, this never awaits, unwraps, id-matches, or times
17
+ * out: the host echoes a response but the runner ignores it. Failures surface
18
+ * only through the optional `onError` hook (debug logging at the call site),
19
+ * keeping the hot test loop non-blocking.
20
+ */ export declare const sendRunnerLifecycle: (request: BrowserDispatchRequest, onError?: (error: unknown) => void) => void;
21
+ export declare const dispatchRpc: <T>({ requestId, request, timeoutMs, timeoutMessage, staleMessage }: {
5
22
  requestId: string;
6
23
  request: BrowserDispatchRequest;
7
24
  timeoutMs: number;
@@ -120,6 +120,5 @@ export declare const isLocator: (value: unknown) => value is Locator;
120
120
  * Forwards to the host provider (e.g. Playwright `selectors.setTestIdAttribute()`).
121
121
  *
122
122
  * @default 'data-testid'
123
- */
124
- export declare const setTestIdAttribute: (attribute: string) => Promise<void>;
125
- export {};
123
+ */ export declare const setTestIdAttribute: (attribute: string) => Promise<void>;
124
+ export { };
@@ -1,4 +1,8 @@
1
- import type { Rstest } from '@rstest/core/browser';
1
+ import { getNumCpus, parseWorkers } from '@rstest/core/internal/browser';
2
+ import type { Rstest } from '@rstest/core/internal/browser';
3
+ // Re-export the shared worker primitives so existing consumers (and unit tests
4
+ // importing from `../src/concurrency`) keep a stable import surface.
5
+ export { getNumCpus, parseWorkers };
2
6
  type HeadlessConcurrencyContext = Pick<Rstest, 'command'> & {
3
7
  normalizedConfig: {
4
8
  pool: {
@@ -6,7 +10,5 @@ type HeadlessConcurrencyContext = Pick<Rstest, 'command'> & {
6
10
  };
7
11
  };
8
12
  };
9
- export declare const parseWorkers: (maxWorkers: string | number, numCpus?: number) => number;
10
13
  export declare const resolveDefaultHeadlessWorkers: (command: HeadlessConcurrencyContext['command'], numCpus?: number) => number;
11
14
  export declare const getHeadlessConcurrency: (context: HeadlessConcurrencyContext, totalTests: number) => number;
12
- export {};
@@ -1,2 +1,2 @@
1
- import type { Rstest } from '@rstest/core/browser';
2
- export declare const validateBrowserConfig: (context: Rstest) => void;
1
+ import type { RstestContext } from '@rstest/core/internal/browser';
2
+ export declare const validateBrowserConfig: (context: RstestContext) => void;
@@ -1,4 +1,4 @@
1
- import type { Reporter } from '@rstest/core/browser';
1
+ import type { Reporter } from '@rstest/core/internal/browser';
2
2
  import { HostDispatchRouter } from './dispatchRouter.js';
3
3
  import type { BrowserClientMessage, BrowserDispatchHandler, SnapshotRpcRequest } from './protocol.js';
4
4
  export type HostDispatchRouterOptions = ConstructorParameters<typeof HostDispatchRouter>[0];
@@ -30,5 +30,5 @@ type CreateHostDispatchRouterOptions = {
30
30
  extensionHandlers?: Map<string, BrowserDispatchHandler>;
31
31
  onDuplicateNamespace?: (namespace: string) => void;
32
32
  };
33
- export declare const createHostDispatchRouter: ({ routerOptions, runnerCallbacks, runSnapshotRpc, extensionHandlers, onDuplicateNamespace, }: CreateHostDispatchRouterOptions) => HostDispatchRouter;
34
- export {};
33
+ export declare const createHostDispatchRouter: ({ routerOptions, runnerCallbacks, runSnapshotRpc, extensionHandlers, onDuplicateNamespace }: CreateHostDispatchRouterOptions) => HostDispatchRouter;
34
+ export { };
@@ -7,8 +7,7 @@ type HostDispatchRouterOptions = {
7
7
  /**
8
8
  * Host-side routing layer for dispatch envelopes.
9
9
  * Capabilities are registered by namespace, while routing stays transport-agnostic.
10
- */
11
- export declare class HostDispatchRouter {
10
+ */ export declare class HostDispatchRouter {
12
11
  private handlers;
13
12
  private options;
14
13
  constructor(options?: HostDispatchRouterOptions);
@@ -17,4 +16,4 @@ export declare class HostDispatchRouter {
17
16
  has(namespace: string): boolean;
18
17
  dispatch(request: BrowserDispatchRequest): Promise<BrowserDispatchResponse>;
19
18
  }
20
- export {};
19
+ export { };
@@ -1,9 +1,9 @@
1
1
  type HeadedSerialTask = () => Promise<void>;
2
+ type HeadedSerialTaskQueue = {
3
+ enqueue: (task: HeadedSerialTask) => Promise<void>;
4
+ };
2
5
  /**
3
6
  * Serializes headed browser file execution so only one task runs at a time.
4
7
  * The queue keeps draining even if an earlier task rejects.
5
- */
6
- export declare const createHeadedSerialTaskQueue: () => {
7
- enqueue: (task: HeadedSerialTask) => Promise<void>;
8
- };
9
- export {};
8
+ */ export declare const createHeadedSerialTaskQueue: () => HeadedSerialTaskQueue;
9
+ export { };
@@ -14,6 +14,5 @@ type HeadlessLatestRerunSchedulerOptions<TFile, TRun> = {
14
14
  /**
15
15
  * Latest-only rerun scheduler for headless watch mode.
16
16
  * Keeps only the newest pending payload and interrupts active run generations.
17
- */
18
- export declare const createHeadlessLatestRerunScheduler: <TFile, TRun>(options: HeadlessLatestRerunSchedulerOptions<TFile, TRun>) => HeadlessLatestRerunScheduler<TFile>;
19
- export {};
17
+ */ export declare const createHeadlessLatestRerunScheduler: <TFile, TRun>(options: HeadlessLatestRerunSchedulerOptions<TFile, TRun>) => HeadlessLatestRerunScheduler<TFile>;
18
+ export { };
@@ -7,6 +7,5 @@ type HeadlessRunnerTransportHandlers = {
7
7
  /**
8
8
  * Headless transport adapter.
9
9
  * This only binds page bridge functions and delegates all scheduling decisions upstream.
10
- */
11
- export declare const attachHeadlessRunnerTransport: (page: BrowserProviderPage, handlers: HeadlessRunnerTransportHandlers) => Promise<void>;
12
- export {};
10
+ */ export declare const attachHeadlessRunnerTransport: (page: BrowserProviderPage, handlers: HeadlessRunnerTransportHandlers) => Promise<void>;
11
+ export { };
@@ -1,4 +1,4 @@
1
- import { type BrowserTestRunOptions, type BrowserTestRunResult, type ListCommandResult, type Rstest } from '@rstest/core/browser';
1
+ import { type BrowserTestRunOptions, type BrowserTestRunResult, type ListCommandResult, type RstestContext } from '@rstest/core/internal/browser';
2
2
  type LazyCompilationModule = {
3
3
  nameForCondition?: () => string | null | undefined;
4
4
  };
@@ -14,8 +14,7 @@ type BrowserLazyCompilationConfig = {
14
14
  * `server.port: 0` because its internal `getPort` never reads back the
15
15
  * OS-assigned ephemeral port. This helper falls back to
16
16
  * `httpServer.address()` to obtain the real bound port.
17
- */
18
- export declare const resolveListenPort: (listenPort: number, httpServer: {
17
+ */ export declare const resolveListenPort: (listenPort: number, httpServer: {
19
18
  address: () => ReturnType<import('node:net').Server['address']>;
20
19
  } | null) => number;
21
20
  export declare const createBrowserLazyCompilationConfig: (setupFiles: string[]) => BrowserLazyCompilationConfig;
@@ -26,13 +25,18 @@ export declare const createBrowserRsbuildDevConfig: (_isWatchMode: boolean) => {
26
25
  logLevel: 'error';
27
26
  };
28
27
  };
29
- export declare const runBrowserController: (context: Rstest, options?: BrowserTestRunOptions) => Promise<BrowserTestRunResult | void>;
28
+ // ============================================================================
29
+ // Main Entry Point
30
+ // ============================================================================
31
+ export declare const runBrowserController: (context: RstestContext, options?: BrowserTestRunOptions) => Promise<BrowserTestRunResult | void>;
32
+ // ============================================================================
33
+ // List Browser Tests
34
+ // ============================================================================
30
35
  /**
31
36
  * Result from collecting browser tests.
32
37
  * This is the return type for listBrowserTests, designed for future extraction
33
38
  * to a separate browser package.
34
- */
35
- export type ListBrowserTestsResult = {
39
+ */ export type ListBrowserTestsResult = {
36
40
  list: ListCommandResult[];
37
41
  close: () => Promise<void>;
38
42
  };
@@ -40,10 +44,9 @@ export type ListBrowserTestsResult = {
40
44
  * Collect test metadata from browser mode projects without running them.
41
45
  * This function creates a headless browser runtime, loads test files,
42
46
  * and collects their test structure (describe/test declarations).
43
- */
44
- export declare const listBrowserTests: (context: Rstest, options?: {
47
+ */ export declare const listBrowserTests: (context: RstestContext, options?: {
45
48
  shardedEntries?: Map<string, {
46
49
  entries: Record<string, string>;
47
50
  }>;
48
51
  }) => Promise<ListBrowserTestsResult>;
49
- export {};
52
+ export { };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import type { BrowserTestRunOptions, BrowserTestRunResult, Rstest } from '@rstest/core/browser';
1
+ import type { BrowserTestRunOptions, BrowserTestRunResult, RstestContext } from '@rstest/core/internal/browser';
2
+ import { validateBrowserConfig } from './configValidation.js';
2
3
  import { type ListBrowserTestsResult } from './hostController.js';
3
- export { validateBrowserConfig } from './configValidation.js';
4
- export { BROWSER_VIEWPORT_PRESET_DIMENSIONS, BROWSER_VIEWPORT_PRESET_IDS, resolveBrowserViewportPreset, } from './viewportPresets.js';
5
- export declare function runBrowserTests(context: Rstest, options?: BrowserTestRunOptions): Promise<BrowserTestRunResult | void>;
6
- export declare function listBrowserTests(context: Rstest): Promise<ListBrowserTestsResult>;
7
- export type { BrowserTestRunOptions, BrowserTestRunResult, ListBrowserTestsResult, };
4
+ export { validateBrowserConfig };
5
+ export declare function runBrowserTests(context: RstestContext, options?: BrowserTestRunOptions): Promise<BrowserTestRunResult | void>;
6
+ export declare function listBrowserTests(context: RstestContext, options?: Pick<BrowserTestRunOptions, 'shardedEntries'>): Promise<ListBrowserTestsResult>;
7
+ export type { BrowserTestRunOptions, BrowserTestRunResult, ListBrowserTestsResult };