@rstest/browser 0.11.3 → 0.11.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.
@@ -45,6 +45,11 @@ export type BrowserProjectRuntime = {
45
45
  */ export type BrowserLogPayload = {
46
46
  level: 'log' | 'warn' | 'error' | 'info' | 'debug';
47
47
  content: string;
48
+ /**
49
+ * Owning project, resolved by the client from its manifest. The host must
50
+ * not re-derive it from `testPath` — concurrent projects can run the same
51
+ * file, so a path-keyed lookup can attribute the log to the wrong project.
52
+ */ projectName: string;
48
53
  taskId?: string;
49
54
  taskName?: string;
50
55
  taskParentNames?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rstest/browser",
3
- "version": "0.11.3",
3
+ "version": "0.11.5",
4
4
  "description": "Browser mode support for Rstest testing framework.",
5
5
  "keywords": [
6
6
  "rstest",
@@ -48,21 +48,21 @@
48
48
  "ws": "^8.21.1"
49
49
  },
50
50
  "devDependencies": {
51
- "@rslib/core": "0.23.2",
51
+ "@rslib/core": "1.0.0-beta.1",
52
52
  "@types/convert-source-map": "^2.0.3",
53
53
  "@types/picomatch": "^4.0.3",
54
54
  "@types/ws": "^8.18.1",
55
- "@vitest/snapshot": "^3.2.7",
55
+ "@vitest/snapshot": "^4.1.10",
56
56
  "birpc": "^4.0.0",
57
57
  "picomatch": "^4.0.5",
58
- "playwright": "^1.61.1",
59
- "@rstest/core": "0.11.3",
58
+ "playwright": "^1.62.0",
60
59
  "@rstest/browser-ui": "0.0.0",
60
+ "@rstest/core": "0.11.5",
61
61
  "@rstest/tsconfig": "0.0.1"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "playwright": "^1.49.1",
65
- "@rstest/core": "^0.11.3"
65
+ "@rstest/core": "^0.11.5"
66
66
  },
67
67
  "peerDependenciesMeta": {
68
68
  "playwright": {
@@ -78,6 +78,7 @@
78
78
  },
79
79
  "scripts": {
80
80
  "build": "rslib build",
81
- "dev": "rslib build --watch"
81
+ "dev": "rslib build --watch",
82
+ "lint": "rslint ."
82
83
  }
83
84
  }
@@ -36,6 +36,7 @@ export async function createBrowserExecutor(
36
36
  const {
37
37
  projects,
38
38
  coverageProvider,
39
+ shardedEntries,
39
40
  freezeShardedEntries,
40
41
  filesOnly,
41
42
  allowEmptyRun,
@@ -90,12 +91,13 @@ export async function createBrowserExecutor(
90
91
  ): Promise<ExecutorCycleOutcome> {
91
92
  const cycle = runBrowserController(context, {
92
93
  projects,
93
- shardedEntries: opts.shardedEntries,
94
+ shardedEntries,
94
95
  freezeShardedEntries,
95
96
  allowEmptyRun,
96
97
  appliedModifyRstestConfigEnvironments,
97
98
  onTraceEvents: opts.onTraceEvents,
98
99
  env: opts.env,
100
+ updateSnapshot: opts.updateSnapshot,
99
101
  });
100
102
  inFlightCycle = cycle;
101
103
  try {
@@ -108,10 +110,10 @@ export async function createBrowserExecutor(
108
110
  inFlightCycle = undefined;
109
111
  }
110
112
  },
111
- async collect(opts): Promise<{ list: ListCommandResult[] }> {
113
+ async collect(): Promise<{ list: ListCommandResult[] }> {
112
114
  const pending = listBrowserTests(context, {
113
115
  projects,
114
- shardedEntries: opts.shardedEntries,
116
+ shardedEntries,
115
117
  freezeShardedEntries,
116
118
  filesOnly,
117
119
  appliedModifyRstestConfigEnvironments,
@@ -142,6 +142,7 @@ const getFileTaskId = (testPath: string): string => {
142
142
  * Returns a restore function to revert console to original.
143
143
  */
144
144
  const interceptConsole = (
145
+ projectName: string,
145
146
  getCurrentTask: () => CurrentTaskInfo | undefined,
146
147
  printConsoleTrace: boolean,
147
148
  ): (() => void) => {
@@ -176,6 +177,7 @@ const interceptConsole = (
176
177
  payload: {
177
178
  level,
178
179
  content,
180
+ projectName,
179
181
  taskId: currentTask?.taskId,
180
182
  taskName: currentTask?.taskName,
181
183
  taskParentNames: currentTask?.taskParentNames,
@@ -605,6 +607,7 @@ const run = async () => {
605
607
  // Intercept console methods to forward logs to host
606
608
  const restoreConsole = shouldInterceptConsole
607
609
  ? interceptConsole(
610
+ projectRuntime.name,
608
611
  () => taskContext.getCurrent() ?? taskStack[taskStack.length - 1],
609
612
  runtimeConfig.disableConsoleIntercept
610
613
  ? false
@@ -45,6 +45,12 @@ const ignoredKeyWarnings: Partial<
45
45
  'a fresh context.',
46
46
  browserOnly: true,
47
47
  },
48
+ federation: {
49
+ isNonDefault: (config) => config.federation === true,
50
+ message: () =>
51
+ 'Ignoring federation in browser mode: it only applies to the Node runner.',
52
+ browserOnly: true,
53
+ },
48
54
  detectAsyncLeaks: {
49
55
  isNonDefault: (config) => config.detectAsyncLeaks === true,
50
56
  message: () =>