@abide/harness 0.3.0 → 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/engine/traceOp.ts +1 -0
- package/src/measure/index.ts +1 -1
- package/src/measure/preload.ts +17 -2
- package/src/runner/runSuite.ts +1 -0
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/engine/traceOp.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// gated there, where the driver below can only run under `bun run bench`.
|
|
8
8
|
|
|
9
9
|
import type { CDPSession, Page } from '@playwright/test'
|
|
10
|
+
|
|
10
11
|
import type { Trace } from './Trace.ts'
|
|
11
12
|
|
|
12
13
|
// `devtools.timeline` carries Paint and the Layout events; the `disabled-by-default`
|
package/src/measure/index.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// `harness/report` is a FOURTH entry and is not a fourth lane: a lane is a DEPENDENCY
|
|
8
8
|
// partition, and the leaf depends on nothing.
|
|
9
9
|
|
|
10
|
-
import { type Batched, type BatchSpec
|
|
10
|
+
import { batch, type Batched, type BatchSpec } from '../report/batch.ts'
|
|
11
11
|
import { emulatedDom, underBun } from '../report/environment.ts'
|
|
12
12
|
import { install, isArmed } from './install.ts'
|
|
13
13
|
|
package/src/measure/preload.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
// members once per case, for the process. `arm()`/`disarm()` swap the record instead,
|
|
9
9
|
// so the prototype shape is fixed for the process lifetime.
|
|
10
10
|
import { GlobalRegistrator } from '@happy-dom/global-registrator'
|
|
11
|
+
|
|
11
12
|
import { install } from './install.ts'
|
|
12
13
|
|
|
13
14
|
// A child spawned with this env would paint its output in ANSI off a pipe (bun's console, and
|
|
@@ -17,7 +18,9 @@ delete process.env.FORCE_COLOR
|
|
|
17
18
|
|
|
18
19
|
// THE WIRE STAYS BUN'S. happy-dom registers its own `fetch` family over bun's, and those drop a
|
|
19
20
|
// `cookie` or `origin` header a test sets, hand a handler a `Blob` with no `bytes()`, and are refused
|
|
20
|
-
// 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.
|
|
21
24
|
const WIRE = [
|
|
22
25
|
'fetch',
|
|
23
26
|
'Request',
|
|
@@ -28,9 +31,21 @@ const WIRE = [
|
|
|
28
31
|
'FormData',
|
|
29
32
|
'AbortController',
|
|
30
33
|
'AbortSignal',
|
|
34
|
+
'WebSocket',
|
|
35
|
+
'TransformStream',
|
|
36
|
+
'WritableStream',
|
|
31
37
|
] as const
|
|
32
38
|
const native: Record<string, unknown> = {}
|
|
33
39
|
for (const name of WIRE) native[name] = globalThis[name]
|
|
34
|
-
|
|
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
|
+
})
|
|
35
50
|
for (const name of WIRE) Object.assign(globalThis, { [name]: native[name] })
|
|
36
51
|
install()
|
package/src/runner/runSuite.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
// answer available.
|
|
12
12
|
|
|
13
13
|
import { tmpdir } from 'node:os' // bun has no temporary-directory lookup of its own
|
|
14
|
+
|
|
14
15
|
import type { TestCase } from '../rows/index.ts'
|
|
15
16
|
|
|
16
17
|
// A RUNNER THAT IS STOPPED STOPS ITS SUITES. SIGTERM reaches this process and nothing under it, so
|