@ultimat3/testing 31.42.0 → 31.42.1
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 +22 -22
- package/src/fixture-island.ts +20 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/testing",
|
|
3
|
-
"version": "31.42.
|
|
3
|
+
"version": "31.42.1",
|
|
4
4
|
"description": "Test harness: cloned template DBs per worker, frozen clock, sealed network, 6 test types",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ultimate",
|
|
@@ -47,27 +47,27 @@
|
|
|
47
47
|
"test": "bun test"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@ultimat3/action": "31.42.
|
|
51
|
-
"@ultimat3/ai": "31.42.
|
|
52
|
-
"@ultimat3/auth": "31.42.
|
|
53
|
-
"@ultimat3/cache": "31.42.
|
|
54
|
-
"@ultimat3/core": "31.42.
|
|
55
|
-
"@ultimat3/db": "31.42.
|
|
56
|
-
"@ultimat3/entity": "31.42.
|
|
57
|
-
"@ultimat3/http": "31.42.
|
|
58
|
-
"@ultimat3/i18n": "31.42.
|
|
59
|
-
"@ultimat3/jobs": "31.42.
|
|
60
|
-
"@ultimat3/mail": "31.42.
|
|
61
|
-
"@ultimat3/notify": "31.42.
|
|
62
|
-
"@ultimat3/policy": "31.42.
|
|
63
|
-
"@ultimat3/pwa": "31.42.
|
|
64
|
-
"@ultimat3/query": "31.42.
|
|
65
|
-
"@ultimat3/realtime": "31.42.
|
|
66
|
-
"@ultimat3/render": "31.42.
|
|
67
|
-
"@ultimat3/schema": "31.42.
|
|
68
|
-
"@ultimat3/scraping": "31.42.
|
|
69
|
-
"@ultimat3/seo": "31.42.
|
|
70
|
-
"@ultimat3/time": "31.42.
|
|
50
|
+
"@ultimat3/action": "31.42.1",
|
|
51
|
+
"@ultimat3/ai": "31.42.1",
|
|
52
|
+
"@ultimat3/auth": "31.42.1",
|
|
53
|
+
"@ultimat3/cache": "31.42.1",
|
|
54
|
+
"@ultimat3/core": "31.42.1",
|
|
55
|
+
"@ultimat3/db": "31.42.1",
|
|
56
|
+
"@ultimat3/entity": "31.42.1",
|
|
57
|
+
"@ultimat3/http": "31.42.1",
|
|
58
|
+
"@ultimat3/i18n": "31.42.1",
|
|
59
|
+
"@ultimat3/jobs": "31.42.1",
|
|
60
|
+
"@ultimat3/mail": "31.42.1",
|
|
61
|
+
"@ultimat3/notify": "31.42.1",
|
|
62
|
+
"@ultimat3/policy": "31.42.1",
|
|
63
|
+
"@ultimat3/pwa": "31.42.1",
|
|
64
|
+
"@ultimat3/query": "31.42.1",
|
|
65
|
+
"@ultimat3/realtime": "31.42.1",
|
|
66
|
+
"@ultimat3/render": "31.42.1",
|
|
67
|
+
"@ultimat3/schema": "31.42.1",
|
|
68
|
+
"@ultimat3/scraping": "31.42.1",
|
|
69
|
+
"@ultimat3/seo": "31.42.1",
|
|
70
|
+
"@ultimat3/time": "31.42.1"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"solid-js": "^1.9.18"
|
package/src/fixture-island.ts
CHANGED
|
@@ -209,18 +209,19 @@ export function disposeLiveIslands(): number {
|
|
|
209
209
|
onFileBoundary(disposeLiveIslands);
|
|
210
210
|
|
|
211
211
|
/**
|
|
212
|
-
* The shipped chunk's source,
|
|
213
|
-
*
|
|
214
|
-
*
|
|
212
|
+
* The shipped chunk's source, from the second build a coverage run asks for. The SAME bundle back
|
|
213
|
+
* is a memo that ignored `options` (`X_TEST_ISLAND_BUILD_REUSED`); a builder that ignores
|
|
214
|
+
* `coverage` altogether answers a fresh bundle and its chunk is what it is.
|
|
215
215
|
*/
|
|
216
216
|
async function shippedCode(
|
|
217
|
-
|
|
217
|
+
file: string,
|
|
218
|
+
shipped: Promise<IslandBundleLike>,
|
|
218
219
|
covered: IslandBundleLike,
|
|
219
220
|
chunk: IslandChunkLike,
|
|
220
221
|
): Promise<string> {
|
|
221
|
-
const bundle = await
|
|
222
|
-
if (bundle === covered) throw new IslandBuildReusedError({ file
|
|
223
|
-
return bundle.chunks.find((each) => each.file ===
|
|
222
|
+
const bundle = await shipped;
|
|
223
|
+
if (bundle === covered) throw new IslandBuildReusedError({ file });
|
|
224
|
+
return bundle.chunks.find((each) => each.file === file)?.code ?? chunk.code;
|
|
224
225
|
}
|
|
225
226
|
|
|
226
227
|
export async function mountIsland(options: MountIslandOptions): Promise<MountedIsland> {
|
|
@@ -238,10 +239,17 @@ export async function mountIsland(options: MountIslandOptions): Promise<MountedI
|
|
|
238
239
|
// being the faster and more honest call regardless. A builder that ignores the argument still
|
|
239
240
|
// works: the `find` below is unchanged.
|
|
240
241
|
const coverage = islandCoverageDir();
|
|
241
|
-
const
|
|
242
|
+
const covered = options.build(options.root, {
|
|
242
243
|
only: options.file,
|
|
243
244
|
...(coverage === undefined ? {} : { coverage: true }),
|
|
244
245
|
});
|
|
246
|
+
// Under coverage the shipped build is asked at the same time, not after: two builds in sequence
|
|
247
|
+
// doubled a mount's time and sent a 5 s test over its budget on a loaded runner.
|
|
248
|
+
const shippedBuild =
|
|
249
|
+
coverage === undefined ? undefined : options.build(options.root, { only: options.file });
|
|
250
|
+
// A covered build that rejects is what the caller sees; the shipped one is not left unawaited.
|
|
251
|
+
shippedBuild?.catch(() => undefined);
|
|
252
|
+
const bundle = await covered;
|
|
245
253
|
const chunk = bundle.chunks.find((each) => each.file === options.file);
|
|
246
254
|
if (chunk === undefined) {
|
|
247
255
|
throw islandNotBuilt(
|
|
@@ -253,7 +261,10 @@ export async function mountIsland(options: MountIslandOptions): Promise<MountedI
|
|
|
253
261
|
|
|
254
262
|
// What `code` answers is what ships: a coverage build keeps whitespace for its map, and an app's
|
|
255
263
|
// size ceiling read it as the chunk (31.27–31.40: green under `bun test`, red in `x verify`).
|
|
256
|
-
const shipped =
|
|
264
|
+
const shipped =
|
|
265
|
+
shippedBuild === undefined
|
|
266
|
+
? chunk.code
|
|
267
|
+
: await shippedCode(options.file, shippedBuild, bundle, chunk);
|
|
257
268
|
|
|
258
269
|
const { documentElement, globals, resizeObservers } = createIslandDocument();
|
|
259
270
|
const restore = installGlobals({ ...globals, ...options.globals });
|