@ultimat3/testing 31.34.0 → 31.36.0
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/errors.ts +6 -6
- package/src/island-errors.ts +1 -1
- package/src/island-selector.ts +1 -1
- package/src/island-state-errors.ts +21 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/testing",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.36.0",
|
|
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.
|
|
51
|
-
"@ultimat3/ai": "31.
|
|
52
|
-
"@ultimat3/auth": "31.
|
|
53
|
-
"@ultimat3/cache": "31.
|
|
54
|
-
"@ultimat3/core": "31.
|
|
55
|
-
"@ultimat3/db": "31.
|
|
56
|
-
"@ultimat3/entity": "31.
|
|
57
|
-
"@ultimat3/http": "31.
|
|
58
|
-
"@ultimat3/i18n": "31.
|
|
59
|
-
"@ultimat3/jobs": "31.
|
|
60
|
-
"@ultimat3/mail": "31.
|
|
61
|
-
"@ultimat3/notify": "31.
|
|
62
|
-
"@ultimat3/policy": "31.
|
|
63
|
-
"@ultimat3/pwa": "31.
|
|
64
|
-
"@ultimat3/query": "31.
|
|
65
|
-
"@ultimat3/realtime": "31.
|
|
66
|
-
"@ultimat3/render": "31.
|
|
67
|
-
"@ultimat3/schema": "31.
|
|
68
|
-
"@ultimat3/scraping": "31.
|
|
69
|
-
"@ultimat3/seo": "31.
|
|
70
|
-
"@ultimat3/time": "31.
|
|
50
|
+
"@ultimat3/action": "31.36.0",
|
|
51
|
+
"@ultimat3/ai": "31.36.0",
|
|
52
|
+
"@ultimat3/auth": "31.36.0",
|
|
53
|
+
"@ultimat3/cache": "31.36.0",
|
|
54
|
+
"@ultimat3/core": "31.36.0",
|
|
55
|
+
"@ultimat3/db": "31.36.0",
|
|
56
|
+
"@ultimat3/entity": "31.36.0",
|
|
57
|
+
"@ultimat3/http": "31.36.0",
|
|
58
|
+
"@ultimat3/i18n": "31.36.0",
|
|
59
|
+
"@ultimat3/jobs": "31.36.0",
|
|
60
|
+
"@ultimat3/mail": "31.36.0",
|
|
61
|
+
"@ultimat3/notify": "31.36.0",
|
|
62
|
+
"@ultimat3/policy": "31.36.0",
|
|
63
|
+
"@ultimat3/pwa": "31.36.0",
|
|
64
|
+
"@ultimat3/query": "31.36.0",
|
|
65
|
+
"@ultimat3/realtime": "31.36.0",
|
|
66
|
+
"@ultimat3/render": "31.36.0",
|
|
67
|
+
"@ultimat3/schema": "31.36.0",
|
|
68
|
+
"@ultimat3/scraping": "31.36.0",
|
|
69
|
+
"@ultimat3/seo": "31.36.0",
|
|
70
|
+
"@ultimat3/time": "31.36.0"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"solid-js": "^1.9.18"
|
package/src/errors.ts
CHANGED
|
@@ -276,7 +276,7 @@ export class FixtureUnknownError extends UltimateError {
|
|
|
276
276
|
input.registered.length === 0
|
|
277
277
|
? `test requested fixture "${input.name}" but none are registered`
|
|
278
278
|
: `test requested fixture "${input.name}"; registered: ${input.registered.join(', ')}`,
|
|
279
|
-
fix: `
|
|
279
|
+
fix: `defineFixtures({ ${input.name}: () => buildIt() }) // register it at test setup`,
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
}
|
|
@@ -296,7 +296,7 @@ export class FixtureUnavailableError extends UltimateError {
|
|
|
296
296
|
super({
|
|
297
297
|
code: 'X_TEST_FIXTURE_UNAVAILABLE',
|
|
298
298
|
cause: `fixture "${input.name}" is declared but nothing in this process drives it — it needs ${input.needs}`,
|
|
299
|
-
fix: `
|
|
299
|
+
fix: `defineFixtures({ ${input.name}: () => yourDriver() }) // install one in the test preload`,
|
|
300
300
|
});
|
|
301
301
|
}
|
|
302
302
|
}
|
|
@@ -380,7 +380,7 @@ export class TestSchemaExpectedError extends UltimateError {
|
|
|
380
380
|
cause: 'toRejectInput/toAcceptInput expect a Standard Schema (`t`), not the action',
|
|
381
381
|
// Names the call, not the intent: "assert against action.input" left the reader to work out
|
|
382
382
|
// which call to edit, and a fix is only executable if it can be pasted over the failing line.
|
|
383
|
-
fix: '
|
|
383
|
+
fix: 'toRejectInput(action.input) // the schema, not toRejectInput(action) or the query',
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
386
|
}
|
|
@@ -408,7 +408,7 @@ export class TestJobExpectedError extends UltimateError {
|
|
|
408
408
|
code: 'X_TEST_JOB_EXPECTED',
|
|
409
409
|
cause: 'toEmitSteps expects a job declaration built with job(...)',
|
|
410
410
|
// Same rule as X_TEST_SCHEMA_EXPECTED's: the paste-able call, not a description of it.
|
|
411
|
-
fix: '
|
|
411
|
+
fix: 'toEmitSteps(myJob) // the job export, not toEmitSteps(myJob.run)',
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
414
|
}
|
|
@@ -426,7 +426,7 @@ export class FactoryTraitUnknownError extends UltimateError {
|
|
|
426
426
|
input.declared.length === 0
|
|
427
427
|
? `factory "${input.table}" was asked for trait "${input.trait}" but declares none`
|
|
428
428
|
: `factory "${input.table}" has no trait "${input.trait}"; declared: ${input.declared.join(', ')}`,
|
|
429
|
-
fix: `
|
|
429
|
+
fix: `defineFactory(${input.table}, { traits: { ${input.trait}: { /* columns */ } } }) // declare the trait`,
|
|
430
430
|
});
|
|
431
431
|
}
|
|
432
432
|
}
|
|
@@ -456,7 +456,7 @@ export class NetworkRaceError extends UltimateError {
|
|
|
456
456
|
super({
|
|
457
457
|
code: 'X_TEST_NETWORK_RACE',
|
|
458
458
|
cause: 'sealed network lost its original fetch mid-request',
|
|
459
|
-
fix: '
|
|
459
|
+
fix: 'await Promise.allSettled(inFlight) // before unsealNetwork(): no request from the same test may still be in flight',
|
|
460
460
|
});
|
|
461
461
|
}
|
|
462
462
|
}
|
package/src/island-errors.ts
CHANGED
|
@@ -73,7 +73,7 @@ export class IslandMountMissingError extends UltimateError {
|
|
|
73
73
|
fix:
|
|
74
74
|
component === undefined
|
|
75
75
|
? `${file} exports nothing a mount could render — x g island <name> --at apps/web/site writes an island whose mount() is already there, and its shape is the one to copy`
|
|
76
|
-
: `
|
|
76
|
+
: `import { mountOver } from '@ultimat3/render/client'; import { render } from 'solid-js/web'; export function mount(el: HTMLElement, props: Parameters<typeof ${component}>[0]): () => void { return mountOver(el, (root) => render(() => <${component} {...props} />, root)); } // add to ${file}`,
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
}
|
package/src/island-selector.ts
CHANGED
|
@@ -61,7 +61,7 @@ export class IslandSelectorUnsupportedError extends UltimateError {
|
|
|
61
61
|
super({
|
|
62
62
|
code: 'X_TEST_ISLAND_SELECTOR_UNSUPPORTED',
|
|
63
63
|
cause: `${JSON.stringify(input.selector)} is not in the island DOM's selector grammar — the part it cannot read starts at ${JSON.stringify(fragment)} (offset ${input.at})`,
|
|
64
|
-
fix: `
|
|
64
|
+
fix: `host.querySelector('li[data-role="row"] > .name') // the grammar: ${SELECTOR_GRAMMAR}; a pseudo-class, a comma or a sibling combinator needs a browser test`,
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
// `registerErrorCodes` call stay in ./errors — one owner, one registration, one place a duplicate
|
|
4
4
|
// can surface.
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
renderCauseValue,
|
|
8
|
+
renderFixLiteral,
|
|
9
|
+
renderFixShellArg,
|
|
10
|
+
UltimateError,
|
|
11
|
+
} from '@ultimat3/core';
|
|
7
12
|
|
|
8
13
|
// No `docs:` on the subclasses below. `UltimateError` fills it from `describeErrorCode(code).docs`.
|
|
9
14
|
|
|
@@ -39,7 +44,7 @@ export class IslandStatesEmptyError extends UltimateError {
|
|
|
39
44
|
super({
|
|
40
45
|
code: 'X_TEST_ISLAND_STATES_EMPTY',
|
|
41
46
|
cause: `defineIslandStates(${renderCauseValue(input.island)}) declares no states, so it can never produce a picture`,
|
|
42
|
-
fix: `
|
|
47
|
+
fix: `states: [{ id: 'empty', title: 'no rows yet', props: {} }] // in ${at(input.island)}`,
|
|
43
48
|
});
|
|
44
49
|
}
|
|
45
50
|
}
|
|
@@ -56,8 +61,8 @@ export class IslandStateIdInvalidError extends UltimateError {
|
|
|
56
61
|
cause: `island state id ${renderCauseValue(input.id)} is not a slug — it becomes the screenshot filename stem`,
|
|
57
62
|
fix:
|
|
58
63
|
input.slug.length === 0
|
|
59
|
-
? `in ${at(input.island)}
|
|
60
|
-
: `
|
|
64
|
+
? `id: 'over-quota' // in ${at(input.island)}: lowercase letters, digits and single dashes`
|
|
65
|
+
: `id: '${input.slug}' // in ${at(input.island)}`,
|
|
61
66
|
});
|
|
62
67
|
}
|
|
63
68
|
}
|
|
@@ -71,7 +76,7 @@ export class IslandStateDuplicateError extends UltimateError {
|
|
|
71
76
|
super({
|
|
72
77
|
code: 'X_TEST_ISLAND_STATE_DUPLICATE',
|
|
73
78
|
cause: `two island states share the id ${renderCauseValue(input.id)}; the second picture would overwrite the first`,
|
|
74
|
-
fix: `in ${at(input.island)} rename one of them —
|
|
79
|
+
fix: `id: '${input.id}-2' // in ${at(input.island)}: rename one of them — or to the state it really is, id: 'over-quota'`,
|
|
75
80
|
});
|
|
76
81
|
}
|
|
77
82
|
}
|
|
@@ -104,7 +109,7 @@ export class IslandStateZoneInvalidError extends UltimateError {
|
|
|
104
109
|
super({
|
|
105
110
|
code: 'X_TEST_ISLAND_STATE_CLOCK_INVALID',
|
|
106
111
|
cause: `timeZone ${renderCauseValue(input.value)} is not an IANA zone, so a rendered date would fall back to the host's`,
|
|
107
|
-
fix: `in ${at(input.island)}
|
|
112
|
+
fix: `timeZone: 'UTC' // in ${at(input.island)} — or one of Intl.supportedValuesOf('timeZone')`,
|
|
108
113
|
});
|
|
109
114
|
}
|
|
110
115
|
}
|
|
@@ -115,7 +120,7 @@ export class IslandStateInstantInvalidError extends UltimateError {
|
|
|
115
120
|
super({
|
|
116
121
|
code: 'X_TEST_ISLAND_STATE_CLOCK_INVALID',
|
|
117
122
|
cause: `now ${renderCauseValue(input.value)} carries no explicit offset, so it means a different moment on every machine`,
|
|
118
|
-
fix: `
|
|
123
|
+
fix: `now: '2026-01-01T00:00:00.000Z' // in ${at(input.island)}: an ISO instant ending in Z or an offset`,
|
|
119
124
|
});
|
|
120
125
|
}
|
|
121
126
|
}
|
|
@@ -130,7 +135,7 @@ export class IslandStateStubInvalidError extends UltimateError {
|
|
|
130
135
|
super({
|
|
131
136
|
code: 'X_TEST_ISLAND_STATE_STUB_INVALID',
|
|
132
137
|
cause: `route stub ${renderCauseValue(input.match)} is not "<METHOD> <pathname>", so it would match no request`,
|
|
133
|
-
fix: `
|
|
138
|
+
fix: `{ match: 'GET /api/settings', respond: { kind: 'json', body: {} } } // in ${at(input.island)}`,
|
|
134
139
|
});
|
|
135
140
|
}
|
|
136
141
|
}
|
|
@@ -162,7 +167,7 @@ export class IslandStatesNotPureError extends UltimateError {
|
|
|
162
167
|
super({
|
|
163
168
|
code: 'X_TEST_ISLAND_STATES_NOT_PURE',
|
|
164
169
|
cause: `${renderCauseValue(input.file)} imports ${renderCauseValue(input.specifier)} — a states file is pure data and is read without a browser`,
|
|
165
|
-
fix: `in ${renderFixLiteral(input.file, STATES_PLACEHOLDER)}
|
|
170
|
+
fix: `props: { … } // in ${renderFixLiteral(input.file, STATES_PLACEHOLDER)}: the props as JSON, and the import of ${renderCauseValue(input.specifier)} deleted`,
|
|
166
171
|
});
|
|
167
172
|
}
|
|
168
173
|
}
|
|
@@ -179,7 +184,7 @@ export class IslandStatesSiblingImportError extends UltimateError {
|
|
|
179
184
|
super({
|
|
180
185
|
code: 'X_TEST_ISLAND_STATES_NOT_PURE',
|
|
181
186
|
cause: `${renderCauseValue(input.file)} imports ${renderCauseValue(input.specifier)} at runtime, and a sibling module can reach the component the states file may not`,
|
|
182
|
-
fix: `
|
|
187
|
+
fix: `import type { Props } from ${renderFixLiteral(input.specifier, '<the specifier the cause names>')} // in ${renderFixLiteral(input.file, STATES_PLACEHOLDER)}: a type-only import is erased, and a value one must be inlined as JSON`,
|
|
183
188
|
});
|
|
184
189
|
}
|
|
185
190
|
}
|
|
@@ -195,7 +200,7 @@ export class IslandStatesOpaqueImportError extends UltimateError {
|
|
|
195
200
|
super({
|
|
196
201
|
code: 'X_TEST_ISLAND_STATES_NOT_PURE',
|
|
197
202
|
cause: `${renderCauseValue(input.file)} computes the import ${renderCauseValue(input.expression)}, so no reader can say where it goes without running it`,
|
|
198
|
-
fix: `in ${renderFixLiteral(input.file, STATES_PLACEHOLDER)}
|
|
203
|
+
fix: `import type { Props } from './props' // in ${renderFixLiteral(input.file, STATES_PLACEHOLDER)}: the specifier as a string literal — or delete the import and inline what it exports as JSON`,
|
|
199
204
|
});
|
|
200
205
|
}
|
|
201
206
|
}
|
|
@@ -210,7 +215,7 @@ export class IslandStatesMissingFileError extends UltimateError {
|
|
|
210
215
|
super({
|
|
211
216
|
code: 'X_TEST_ISLAND_STATES_MISSING_FILE',
|
|
212
217
|
cause: `no file at ${renderCauseValue(input.island)} under ${renderCauseValue(input.root)}, so its declared states can never be photographed`,
|
|
213
|
-
fix: `in ${at(input.island)}
|
|
218
|
+
fix: `island: 'apps/web/app/settings/settings.island.tsx' // in ${at(input.island)}: the path that exists, relative to the app root, not to the states file`,
|
|
214
219
|
});
|
|
215
220
|
}
|
|
216
221
|
}
|
|
@@ -230,8 +235,8 @@ export class IslandStatesUnknownError extends UltimateError {
|
|
|
230
235
|
: `no island states answer to ${renderCauseValue(input.name)}; declared: ${input.known.join(', ')}`,
|
|
231
236
|
fix:
|
|
232
237
|
input.known.length === 0
|
|
233
|
-
? "
|
|
234
|
-
: `
|
|
238
|
+
? "export const states = defineIslandStates({ island: 'apps/web/app/settings/settings.island.tsx', states: [...] }) // beside the island"
|
|
239
|
+
: `x shot --island ${renderFixShellArg(input.known[0], '<a declared name>')} # one of the declared names the cause lists`,
|
|
235
240
|
});
|
|
236
241
|
}
|
|
237
242
|
}
|
|
@@ -246,7 +251,7 @@ export class IslandStatesAmbiguousError extends UltimateError {
|
|
|
246
251
|
super({
|
|
247
252
|
code: 'X_TEST_ISLAND_STATES_AMBIGUOUS',
|
|
248
253
|
cause: `${input.islands.length} islands answer to ${renderCauseValue(input.name)}: ${input.islands.join(', ')}`,
|
|
249
|
-
fix: `
|
|
254
|
+
fix: `git mv ${renderFixShellArg(input.islands[1], '<the second island the cause names>')} <a-distinct-basename>.island.tsx # the basename is the shot directory, so today the two would share one`,
|
|
250
255
|
});
|
|
251
256
|
}
|
|
252
257
|
}
|
|
@@ -265,7 +270,7 @@ export class IslandStateUnknownError extends UltimateError {
|
|
|
265
270
|
super({
|
|
266
271
|
code: 'X_TEST_ISLAND_STATE_UNKNOWN',
|
|
267
272
|
cause: `${renderCauseValue(input.island)} declares no state ${renderCauseValue(input.id)}; declared: ${input.known.join(', ')}`,
|
|
268
|
-
fix: `
|
|
273
|
+
fix: `mountIslandState(states, ${renderFixLiteral(input.known[0], "'<a declared id>'")}, { build: buildIslands, root }) // a declared id — or declare the state in ${at(input.island)}`,
|
|
269
274
|
});
|
|
270
275
|
}
|
|
271
276
|
}
|