@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.
- package/dist/browser-container/container-static/js/506.b2f920fa67.js +194 -0
- package/dist/browser-container/container-static/js/index.d27fd63f5e.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/index.js +290 -245
- package/dist/protocol.d.ts +5 -0
- package/package.json +8 -7
- package/src/browserExecutor.ts +5 -3
- package/src/client/entry.ts +3 -0
- package/src/configValidation.ts +6 -0
- package/src/hostController.ts +556 -286
- package/src/protocol.ts +6 -0
- package/dist/browser-container/container-static/js/949.7d935e2ac9.js +0 -27406
- package/dist/browser-container/container-static/js/949.7d935e2ac9.js.LICENSE.txt +0 -1
- package/dist/browser-container/container-static/js/index.492a6c2f8b.js +0 -3053
- 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/watchCliShortcuts.d.ts +0 -6
- package/src/AGENTS.md +0 -150
- package/src/client/AGENTS.md +0 -89
- package/src/watchCliShortcuts.ts +0 -77
package/dist/protocol.d.ts
CHANGED
|
@@ -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
|
+
"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.
|
|
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": "^
|
|
55
|
+
"@vitest/snapshot": "^4.1.10",
|
|
56
56
|
"birpc": "^4.0.0",
|
|
57
57
|
"picomatch": "^4.0.5",
|
|
58
|
-
"playwright": "^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.
|
|
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
|
}
|
package/src/browserExecutor.ts
CHANGED
|
@@ -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
|
|
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(
|
|
113
|
+
async collect(): Promise<{ list: ListCommandResult[] }> {
|
|
112
114
|
const pending = listBrowserTests(context, {
|
|
113
115
|
projects,
|
|
114
|
-
shardedEntries
|
|
116
|
+
shardedEntries,
|
|
115
117
|
freezeShardedEntries,
|
|
116
118
|
filesOnly,
|
|
117
119
|
appliedModifyRstestConfigEnvironments,
|
package/src/client/entry.ts
CHANGED
|
@@ -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
|
package/src/configValidation.ts
CHANGED
|
@@ -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: () =>
|