@jskit-ai/shell-web 0.1.255 → 0.2.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/CHANGELOG.md +45 -0
- package/locales/en.json +49 -0
- package/package.json +4 -3
- package/src/client/asyncModuleRecovery/runtime.js +14 -7
- package/src/client/clientUpdate/runtime.js +86 -0
- package/src/client/components/ShellErrorHost.vue +15 -10
- package/src/client/components/ShellLayout.vue +9 -6
- package/src/client/components/ShellMenuLinkItem.vue +10 -5
- package/src/client/components/ShellNavigationTooltip.vue +4 -2
- package/src/client/components/ShellOutlet.vue +25 -1
- package/src/client/components/ShellOutletMenuWidget.vue +6 -2
- package/src/client/components/ShellSurfaceAwareMenuLinkItem.vue +4 -4
- package/src/client/components/ShellTabLinkItem.vue +4 -2
- package/src/client/composables/useShellLayoutState.js +7 -3
- package/src/client/composables/useShellNavigationLink.js +8 -2
- package/src/client/composables/useShellPullToRefresh.js +4 -2
- package/src/client/error/runtime.js +25 -3
- package/src/client/error/store.js +17 -1
- package/src/client/i18n.js +8 -0
- package/src/client/providers/ShellWebClientProvider.js +22 -6
- package/src/client/providers/appModuleLoadFailure.js +4 -1
- package/src/client/requestRecovery/runtime.js +21 -14
- package/src/client/runtime/bootstrapRuntime.js +4 -1
- package/src/client/runtime/refreshRuntime.js +5 -2
- package/src/client/support/drawerPresentation.js +5 -2
- package/test/clientUpdate.test.js +241 -0
- package/test/i18nCatalog.test.js +16 -0
- package/test/provider.test.js +1 -0
- package/test/translation.test.js +110 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { once } from "node:events";
|
|
3
|
+
import { createServer } from "node:http";
|
|
4
|
+
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
5
|
+
import os from "node:os";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import test from "node:test";
|
|
8
|
+
import { createPinia } from "pinia";
|
|
9
|
+
import { createCapabilityRuntime, defineProvider } from "@jskit-ai/kernel/shared/capabilities";
|
|
10
|
+
import { EventProvider } from "@jskit-ai/kernel/server/runtime";
|
|
11
|
+
import { createSurfaceRuntime } from "@jskit-ai/kernel/shared/surface/runtime";
|
|
12
|
+
import { createClientComponentRegistry } from "../../kernel/client/componentRegistry.js";
|
|
13
|
+
import { RealtimeClientProvider } from "../../realtime/src/client/RealtimeClientProvider.js";
|
|
14
|
+
import { RealtimeProvider } from "../../realtime/src/server/RealtimeProvider.js";
|
|
15
|
+
import { ShellWebClientProvider } from "../src/client/providers/ShellWebClientProvider.js";
|
|
16
|
+
|
|
17
|
+
const CLIENT_APP_CONFIG_GLOBAL_KEY = "__JSKIT_CLIENT_APP_CONFIG__";
|
|
18
|
+
const PAGE_BUILD = "aaaaaaaaaaaaaaaa";
|
|
19
|
+
const NEW_BUILD = "bbbbbbbbbbbbbbbb";
|
|
20
|
+
const NEWER_BUILD = "cccccccccccccccc";
|
|
21
|
+
const logger = Object.freeze({ debug() {}, info() {}, warn() {}, error() {} });
|
|
22
|
+
|
|
23
|
+
const originalGlobals = new WeakMap();
|
|
24
|
+
|
|
25
|
+
// Each global is restored to its value from before the test, however often the test sets it.
|
|
26
|
+
function setGlobal(t, name, value) {
|
|
27
|
+
if (!originalGlobals.has(t)) {
|
|
28
|
+
const originals = new Map();
|
|
29
|
+
originalGlobals.set(t, originals);
|
|
30
|
+
t.after(() => {
|
|
31
|
+
for (const [key, original] of originals) {
|
|
32
|
+
if (original.had) globalThis[key] = original.value;
|
|
33
|
+
else delete globalThis[key];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const originals = originalGlobals.get(t);
|
|
38
|
+
if (!originals.has(name)) {
|
|
39
|
+
originals.set(name, { had: Object.hasOwn(globalThis, name), value: globalThis[name] });
|
|
40
|
+
}
|
|
41
|
+
globalThis[name] = value;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// The page as it loaded: its <title> and, when built, its build id.
|
|
45
|
+
function loadPage(t, { buildId = PAGE_BUILD, title = "Vibe Test" } = {}) {
|
|
46
|
+
setGlobal(t, "document", Object.assign(new EventTarget(), {
|
|
47
|
+
hidden: false,
|
|
48
|
+
title,
|
|
49
|
+
querySelector: (selector) => (selector === 'meta[name="jskit-client-build"]' && buildId
|
|
50
|
+
? { getAttribute: (name) => (name === "content" ? buildId : null) }
|
|
51
|
+
: null)
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// The shape of client.realtime's served-build subscription, driven by the test.
|
|
56
|
+
function createRealtimeStandIn() {
|
|
57
|
+
const listeners = new Set();
|
|
58
|
+
let latest = "";
|
|
59
|
+
return {
|
|
60
|
+
connect(buildId) {
|
|
61
|
+
latest = buildId;
|
|
62
|
+
for (const listener of [...listeners]) listener(buildId);
|
|
63
|
+
},
|
|
64
|
+
listenerCount: () => listeners.size,
|
|
65
|
+
capability: {
|
|
66
|
+
onServedClientBuild(listener) {
|
|
67
|
+
listeners.add(listener);
|
|
68
|
+
if (latest) listener(latest);
|
|
69
|
+
return () => listeners.delete(listener);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Starts the client with the shell (and any other providers), and returns the
|
|
76
|
+
// capabilities the probe names once they are set up.
|
|
77
|
+
async function startClient(t, { inputs = {}, providers = [], probe = { shell: "client.shell" } } = {}) {
|
|
78
|
+
setGlobal(t, "fetch", async () => ({ ok: true, status: 200, json: async () => ({}) }));
|
|
79
|
+
const captured = {};
|
|
80
|
+
const Probe = defineProvider({
|
|
81
|
+
id: "test.client-update.probe",
|
|
82
|
+
requires: probe,
|
|
83
|
+
setup(dependencies) {
|
|
84
|
+
Object.assign(captured, dependencies);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
const runtime = createCapabilityRuntime({
|
|
88
|
+
profile: "test",
|
|
89
|
+
providers: [ShellWebClientProvider, ...providers, Probe],
|
|
90
|
+
inputs: {
|
|
91
|
+
"client.components": createClientComponentRegistry(),
|
|
92
|
+
"client.env": {},
|
|
93
|
+
"client.logger": logger,
|
|
94
|
+
"client.pinia": createPinia(),
|
|
95
|
+
"client.query": null,
|
|
96
|
+
"client.router": { currentRoute: { value: { path: "/" } }, onError: () => () => {} },
|
|
97
|
+
"client.surface": createSurfaceRuntime({
|
|
98
|
+
allMode: "all",
|
|
99
|
+
surfaces: { app: { id: "app", pagesRoot: "app", enabled: true } },
|
|
100
|
+
defaultSurfaceId: "app"
|
|
101
|
+
}),
|
|
102
|
+
"client.vue": { config: {}, provide() {}, use() { return this; } },
|
|
103
|
+
...inputs
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
await runtime.start();
|
|
107
|
+
t.after(() => (runtime.diagnostics().lifecycleState === "started" ? runtime.shutdown() : null));
|
|
108
|
+
return { runtime, ...captured };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async function waitFor(predicate, label) {
|
|
112
|
+
const deadline = Date.now() + 8_000;
|
|
113
|
+
while (!predicate()) {
|
|
114
|
+
if (Date.now() > deadline) throw new Error(`Timed out waiting until ${label}.`);
|
|
115
|
+
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function banners(shell) {
|
|
120
|
+
return shell.errorPresentationStore.getState().channels.banner;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
test("a page running an older build offers a reload once; the served build itself shows nothing", async (t) => {
|
|
124
|
+
loadPage(t);
|
|
125
|
+
const realtime = createRealtimeStandIn();
|
|
126
|
+
const { shell } = await startClient(t, { inputs: { "client.realtime": realtime.capability } });
|
|
127
|
+
|
|
128
|
+
realtime.connect(PAGE_BUILD);
|
|
129
|
+
assert.deepEqual(banners(shell), [], "the page already runs the build its server serves");
|
|
130
|
+
|
|
131
|
+
realtime.connect(NEW_BUILD);
|
|
132
|
+
assert.equal(banners(shell).length, 1);
|
|
133
|
+
const [offer] = banners(shell);
|
|
134
|
+
assert.equal(offer.message, "Vibe Test was updated. Reload to get the latest version.");
|
|
135
|
+
assert.equal(offer.messageCode, "shell.recovery.appUpdated");
|
|
136
|
+
assert.equal(offer.severity, "info");
|
|
137
|
+
assert.equal(offer.action.label, "Reload");
|
|
138
|
+
|
|
139
|
+
realtime.connect(NEW_BUILD);
|
|
140
|
+
assert.equal(banners(shell).length, 1, "a reconnection to the same build does not repeat the offer");
|
|
141
|
+
|
|
142
|
+
// Reload returns to the same address, and only when the person chooses it.
|
|
143
|
+
const reloads = [];
|
|
144
|
+
const checks = [];
|
|
145
|
+
setGlobal(t, "window", Object.assign(new EventTarget(), {
|
|
146
|
+
location: { href: "http://app.test/app/project?tab=chat", reload: () => reloads.push("reload") }
|
|
147
|
+
}));
|
|
148
|
+
setGlobal(t, "fetch", async (url, options) => {
|
|
149
|
+
checks.push({ url, cache: options.cache });
|
|
150
|
+
return { ok: true, status: 200 };
|
|
151
|
+
});
|
|
152
|
+
assert.deepEqual(reloads, [], "the page never reloads by itself");
|
|
153
|
+
assert.equal(await offer.action.handler(), true);
|
|
154
|
+
assert.deepEqual(checks, [{ url: "http://app.test/app/project?tab=chat", cache: "no-store" }]);
|
|
155
|
+
assert.deepEqual(reloads, ["reload"]);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
test("a closed offer stays closed for its build, a newer build offers again, and the served page build withdraws it", async (t) => {
|
|
159
|
+
loadPage(t, { title: "" });
|
|
160
|
+
const realtime = createRealtimeStandIn();
|
|
161
|
+
const { shell } = await startClient(t, { inputs: { "client.realtime": realtime.capability } });
|
|
162
|
+
|
|
163
|
+
realtime.connect(NEW_BUILD);
|
|
164
|
+
assert.equal(banners(shell)[0].message, "This app was updated. Reload to get the latest version.");
|
|
165
|
+
shell.error.dismiss(banners(shell)[0].id);
|
|
166
|
+
realtime.connect(NEW_BUILD);
|
|
167
|
+
assert.deepEqual(banners(shell), [], "the person closed the offer for this build");
|
|
168
|
+
|
|
169
|
+
realtime.connect(NEWER_BUILD);
|
|
170
|
+
assert.equal(banners(shell).length, 1, "a newer update offers again");
|
|
171
|
+
realtime.connect(PAGE_BUILD);
|
|
172
|
+
assert.deepEqual(banners(shell), [], "a server back on the page's own build withdraws the offer");
|
|
173
|
+
|
|
174
|
+
assert.equal(realtime.listenerCount(), 1);
|
|
175
|
+
await shell.clientUpdate.dispose();
|
|
176
|
+
assert.equal(realtime.listenerCount(), 0);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
test("a development page, which has no build id, never offers a reload", async (t) => {
|
|
180
|
+
loadPage(t, { buildId: "" });
|
|
181
|
+
const realtime = createRealtimeStandIn();
|
|
182
|
+
const { shell } = await startClient(t, { inputs: { "client.realtime": realtime.capability } });
|
|
183
|
+
realtime.connect(NEW_BUILD);
|
|
184
|
+
assert.deepEqual(banners(shell), []);
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
test("reconnecting to a restarted server that serves a new build offers a reload", async (t) => {
|
|
188
|
+
loadPage(t);
|
|
189
|
+
const appRoot = await mkdtemp(path.join(os.tmpdir(), "shell-client-update-"));
|
|
190
|
+
t.after(() => rm(appRoot, { recursive: true, force: true }));
|
|
191
|
+
async function serve(buildId) {
|
|
192
|
+
await mkdir(path.join(appRoot, "dist"), { recursive: true });
|
|
193
|
+
await writeFile(path.join(appRoot, "dist", "index.html"),
|
|
194
|
+
`<!doctype html><html><head><meta name="jskit-client-build" content="${buildId}"></head></html>`);
|
|
195
|
+
}
|
|
196
|
+
// One server process: its own HTTP server and realtime runtime.
|
|
197
|
+
async function startServer(port = 0) {
|
|
198
|
+
const http = createServer();
|
|
199
|
+
const runtime = createCapabilityRuntime({ providers: [EventProvider, RealtimeProvider], inputs: {
|
|
200
|
+
"runtime.app-root": appRoot, "runtime.config": {}, "runtime.env": {},
|
|
201
|
+
"runtime.fastify": { server: http }, "runtime.logger": logger
|
|
202
|
+
} });
|
|
203
|
+
await runtime.start();
|
|
204
|
+
http.listen(port, "127.0.0.1");
|
|
205
|
+
await once(http, "listening");
|
|
206
|
+
return {
|
|
207
|
+
port: http.address().port,
|
|
208
|
+
async stop() {
|
|
209
|
+
await runtime.shutdown();
|
|
210
|
+
http.closeAllConnections();
|
|
211
|
+
await new Promise((resolve) => http.close(resolve));
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
await serve(PAGE_BUILD);
|
|
217
|
+
let server = await startServer();
|
|
218
|
+
const { port } = server;
|
|
219
|
+
t.after(() => server?.stop());
|
|
220
|
+
setGlobal(t, CLIENT_APP_CONFIG_GLOBAL_KEY, Object.freeze({ realtimeClient: {
|
|
221
|
+
url: `http://127.0.0.1:${port}`,
|
|
222
|
+
options: { transports: ["websocket"], reconnectionDelay: 50, reconnectionDelayMax: 100, randomizationFactor: 0 }
|
|
223
|
+
} }));
|
|
224
|
+
const { runtime: client, realtime, shell } = await startClient(t, {
|
|
225
|
+
providers: [RealtimeClientProvider],
|
|
226
|
+
probe: { realtime: "client.realtime", shell: "client.shell" }
|
|
227
|
+
});
|
|
228
|
+
const served = [];
|
|
229
|
+
realtime.onServedClientBuild((buildId) => served.push(buildId));
|
|
230
|
+
await waitFor(() => served.length === 1, "the server names the build it serves");
|
|
231
|
+
assert.deepEqual(banners(shell), [], "connected to a server that serves this page's build");
|
|
232
|
+
|
|
233
|
+
await server.stop();
|
|
234
|
+
server = null;
|
|
235
|
+
await serve(NEW_BUILD);
|
|
236
|
+
server = await startServer(port);
|
|
237
|
+
await waitFor(() => banners(shell).length === 1, "the reconnection offers a reload");
|
|
238
|
+
assert.equal(banners(shell)[0].message, "Vibe Test was updated. Reload to get the latest version.");
|
|
239
|
+
assert.deepEqual(served, [PAGE_BUILD, NEW_BUILD]);
|
|
240
|
+
await client.shutdown();
|
|
241
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import test from "node:test";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { evaluateI18nCatalogContract } from "../../../tooling/test-support/i18nCatalogContract.mjs";
|
|
6
|
+
|
|
7
|
+
const TEST_DIRECTORY = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const REPO_ROOT = path.resolve(TEST_DIRECTORY, "..", "..", "..");
|
|
9
|
+
|
|
10
|
+
test("shell-web English catalog matches its source", () => {
|
|
11
|
+
const { problems } = evaluateI18nCatalogContract({
|
|
12
|
+
repoRoot: REPO_ROOT,
|
|
13
|
+
packageDir: path.join(REPO_ROOT, "packages", "shell-web")
|
|
14
|
+
});
|
|
15
|
+
assert.deepEqual(problems, []);
|
|
16
|
+
});
|
package/test/provider.test.js
CHANGED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
import { createI18n } from "vue-i18n";
|
|
4
|
+
import { setJskitI18n, useJskitText } from "@jskit-ai/kernel/client/i18n";
|
|
5
|
+
import { flattenCatalog } from "@jskit-ai/kernel/shared/i18n";
|
|
6
|
+
import en from "../locales/en.json" with { type: "json" };
|
|
7
|
+
import { createErrorRuntime } from "../src/client/error/runtime.js";
|
|
8
|
+
import { createErrorPresentationStore } from "../src/client/error/store.js";
|
|
9
|
+
import { createDefaultMaterialErrorPresenters } from "../src/client/error/presenters.js";
|
|
10
|
+
import { requestRecoveryMessage } from "../src/client/requestRecovery/runtime.js";
|
|
11
|
+
import { resolveShellDrawerToggleLabel } from "../src/client/support/drawerPresentation.js";
|
|
12
|
+
|
|
13
|
+
// A test language with every shell key translated, plus the kernel code used below.
|
|
14
|
+
function testLanguageMessages() {
|
|
15
|
+
const messages = {};
|
|
16
|
+
for (const [key, message] of Object.entries({
|
|
17
|
+
...flattenCatalog(en),
|
|
18
|
+
"jskit.errors.not_found": "Not found."
|
|
19
|
+
})) {
|
|
20
|
+
let target = messages;
|
|
21
|
+
const segments = key.split(".");
|
|
22
|
+
for (const segment of segments.slice(0, -1)) {
|
|
23
|
+
target = target[segment] ||= {};
|
|
24
|
+
}
|
|
25
|
+
target[segments.at(-1)] = `[xx] ${message}`;
|
|
26
|
+
}
|
|
27
|
+
return messages;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function withTestLanguage(run) {
|
|
31
|
+
setJskitI18n(createI18n({ legacy: false, locale: "xx", messages: { xx: testLanguageMessages() } }));
|
|
32
|
+
try {
|
|
33
|
+
return run();
|
|
34
|
+
} finally {
|
|
35
|
+
setJskitI18n(null);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function createStoreRuntime() {
|
|
40
|
+
const store = createErrorPresentationStore();
|
|
41
|
+
const runtime = createErrorRuntime({
|
|
42
|
+
presenters: createDefaultMaterialErrorPresenters({ store }),
|
|
43
|
+
moduleDefaultPresenterId: "material.snackbar"
|
|
44
|
+
});
|
|
45
|
+
return { store, runtime };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
test("shell texts stay English without an app vue-i18n instance", () => {
|
|
49
|
+
assert.equal(
|
|
50
|
+
requestRecoveryMessage(null),
|
|
51
|
+
"The app could not reach the server or network. Check the connection and try again."
|
|
52
|
+
);
|
|
53
|
+
assert.equal(resolveShellDrawerToggleLabel({ compact: true, open: false }), "Open navigation menu");
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test("shell texts follow the app's active language", () => {
|
|
57
|
+
withTestLanguage(() => {
|
|
58
|
+
assert.equal(
|
|
59
|
+
requestRecoveryMessage(null),
|
|
60
|
+
"[xx] The app could not reach the server or network. Check the connection and try again."
|
|
61
|
+
);
|
|
62
|
+
assert.equal(
|
|
63
|
+
requestRecoveryMessage(null, { label: "jskit.shell.recovery.appDataLabel" }),
|
|
64
|
+
"[xx] [xx] App data could not reach the server or network. Check the connection and try again."
|
|
65
|
+
);
|
|
66
|
+
assert.equal(resolveShellDrawerToggleLabel({ compact: false, open: true }), "[xx] Collapse navigation drawer");
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test("presented errors keep their server code so the error host can translate them", () => {
|
|
71
|
+
const { store, runtime } = createStoreRuntime();
|
|
72
|
+
const serverError = Object.assign(new Error("Not found."), { status: 404, code: "not_found", params: {} });
|
|
73
|
+
runtime.report({ cause: serverError, intent: "action-feedback" });
|
|
74
|
+
runtime.report({ message: "Contact not found.", cause: Object.assign(new Error("Contact not found."), { code: "not_found" }) });
|
|
75
|
+
|
|
76
|
+
const [generic, appSentence] = store.getState().channels.snackbar;
|
|
77
|
+
assert.equal(generic.code, "not_found");
|
|
78
|
+
assert.equal(generic.message, "Not found.");
|
|
79
|
+
|
|
80
|
+
withTestLanguage(() => {
|
|
81
|
+
const { serverMessage } = useJskitText();
|
|
82
|
+
assert.equal(serverMessage(generic), "[xx] Not found.");
|
|
83
|
+
assert.equal(serverMessage(appSentence), "Contact not found.");
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test("presented client errors keep their messageCode from the cause", () => {
|
|
88
|
+
const { store, runtime } = createStoreRuntime();
|
|
89
|
+
const uiError = Object.assign(new Error("Unexpected UI error."), {
|
|
90
|
+
messageCode: "shell.error.unexpectedUi",
|
|
91
|
+
messageParams: {}
|
|
92
|
+
});
|
|
93
|
+
runtime.report({ cause: uiError });
|
|
94
|
+
|
|
95
|
+
const [entry] = store.getState().channels.snackbar;
|
|
96
|
+
assert.equal(entry.messageCode, "shell.error.unexpectedUi");
|
|
97
|
+
withTestLanguage(() => {
|
|
98
|
+
assert.equal(useJskitText().serverMessage(entry), "[xx] Unexpected UI error.");
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test("a module that fails to load is reported with the kernel's sentence code", async () => {
|
|
103
|
+
const { createShellAsyncModuleRecoveryRuntime } = await import("../src/client/asyncModuleRecovery/runtime.js");
|
|
104
|
+
const reports = [];
|
|
105
|
+
const runtime = createShellAsyncModuleRecoveryRuntime({ errorRuntime: { report: (entry) => reports.push(entry) } });
|
|
106
|
+
runtime.notify(new TypeError("Failed to fetch dynamically imported module: /src/x.js"));
|
|
107
|
+
assert.equal(reports.length, 1);
|
|
108
|
+
assert.equal(reports[0].message, "App module did not download. The app may have been updated, or the network request failed.");
|
|
109
|
+
assert.equal(reports[0].messageCode, "kernel.moduleLoad.appModuleNotDownloaded");
|
|
110
|
+
});
|