@abide/harness 0.3.1 → 0.3.2
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/package.json +2 -2
- package/src/measure/preload.ts +16 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abide/harness",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Ratios against hand-written code, counts of the work an op did, and gates whose revert can be run — three measurement lanes for anything that renders, on bun",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@playwright/test": "^1.64.0",
|
|
61
|
-
"@abide/abide": ">=0.
|
|
61
|
+
"@abide/abide": ">=0.125.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependenciesMeta": {
|
|
64
64
|
"@playwright/test": {
|
package/src/measure/preload.ts
CHANGED
|
@@ -18,7 +18,9 @@ delete process.env.FORCE_COLOR
|
|
|
18
18
|
|
|
19
19
|
// THE WIRE STAYS BUN'S. happy-dom registers its own `fetch` family over bun's, and those drop a
|
|
20
20
|
// `cookie` or `origin` header a test sets, hand a handler a `Blob` with no `bytes()`, and are refused
|
|
21
|
-
// by `Bun.serve
|
|
21
|
+
// by `Bun.serve`; its `WebSocket` takes none of the upgrade headers bun's does, and its
|
|
22
|
+
// `TransformStream` and `WritableStream` are node's `Transform` and `Writable`, not web streams. The
|
|
23
|
+
// DOM reaches its own through its window either way.
|
|
22
24
|
const WIRE = [
|
|
23
25
|
'fetch',
|
|
24
26
|
'Request',
|
|
@@ -29,9 +31,21 @@ const WIRE = [
|
|
|
29
31
|
'FormData',
|
|
30
32
|
'AbortController',
|
|
31
33
|
'AbortSignal',
|
|
34
|
+
'WebSocket',
|
|
35
|
+
'TransformStream',
|
|
36
|
+
'WritableStream',
|
|
32
37
|
] as const
|
|
33
38
|
const native: Record<string, unknown> = {}
|
|
34
39
|
for (const name of WIRE) native[name] = globalThis[name]
|
|
35
|
-
|
|
40
|
+
// 43.35 — a document a test parses names its stylesheets and scripts, and a DOM that fetched them
|
|
41
|
+
// would fetch them from a host nothing answers, in whichever test file happened to parse one.
|
|
42
|
+
GlobalRegistrator.register({
|
|
43
|
+
url: 'http://localhost/',
|
|
44
|
+
settings: {
|
|
45
|
+
disableCSSFileLoading: true,
|
|
46
|
+
disableJavaScriptFileLoading: true,
|
|
47
|
+
handleDisabledFileLoadingAsSuccess: true,
|
|
48
|
+
},
|
|
49
|
+
})
|
|
36
50
|
for (const name of WIRE) Object.assign(globalThis, { [name]: native[name] })
|
|
37
51
|
install()
|