Open History to see the last commit
1import * as NodeServices from "@effect/platform-node/NodeServices";
2import { assert, describe, it } from "@effect/vitest";
3import * as Deferred from "effect/Deferred";
4import * as Effect from "effect/Effect";
5import * as FileSystem from "effect/FileSystem";
6import * as Layer from "effect/Layer";
7import * as Option from "effect/Option";
8import * as Path from "effect/Path";
9import * as PlatformError from "effect/PlatformError";
10import * as Sink from "effect/Sink";
11import * as Stream from "effect/Stream";
12import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";
13
14import * as DesktopEnvironment from "./DesktopEnvironment.ts";
15import * as DesktopAssets from "./DesktopAssets.ts";
16import * as DesktopLinuxUrlHandler from "./DesktopLinuxUrlHandler.ts";
17
18interface RecordedRegistration {
19 readonly directories: string[];
20 readonly files: Array<{ readonly path: string; readonly content: string }>;
21 readonly commands: Array<{ readonly command: string; readonly args: ReadonlyArray<string> }>;
22 readonly copies: Array<{ readonly source: string; readonly destination: string }>;
23}
24
25const makeEnvironment = (path: Path.Path, overrides: Record<string, unknown> = {}) =>
26 DesktopEnvironment.DesktopEnvironment.of({
27 platform: "linux",
28 isPackaged: true,
29 isDevelopment: false,
30 displayName: "T3 Code (Alpha)",
31 linuxDesktopEntryName: "com.t3tools.T3Code.desktop",
32 linuxWmClass: "t3code",
33 linuxApplicationsDir: "/home/alice/.local/share/applications",
34 desktopLauncherPath: Option.none(),
35 appImagePath: Option.some("/home/alice/Applications/T3-Code.AppImage"),
36 path,
37 ...overrides,
38 } as unknown as DesktopEnvironment.DesktopEnvironment["Service"]);
39
40const mockProcess = (exitCode: number, stalled = false) =>
41 ChildProcessSpawner.makeHandle({
42 pid: ChildProcessSpawner.ProcessId(1),
43 exitCode: stalled ? Effect.never : Effect.succeed(ChildProcessSpawner.ExitCode(exitCode)),
44 isRunning: Effect.succeed(false),
45 kill: () => Effect.void,
46 unref: Effect.succeed(Effect.void),
47 stdin: Sink.drain,
48 stdout: Stream.empty,
49 stderr: Stream.empty,
50 all: Stream.empty,
51 getInputFd: () => Sink.drain,
52 getOutputFd: () => Stream.empty,
53 });
54
55const layerHandler = (
56 recorded: RecordedRegistration,
57 input: {
58 readonly environment?: Record<string, unknown>;
59 readonly updateDesktopDatabaseExitCode?: number;
60 readonly updateDesktopDatabaseStalled?: boolean;
61 readonly updateDesktopDatabaseStarted?: Deferred.Deferred<void>;
62 readonly xdgMimeExitCode?: number;
63 readonly writeError?: PlatformError.PlatformError;
64 readonly existingEntry?: string;
65 readonly iconSource?: string;
66 readonly iconCopyError?: PlatformError.PlatformError;
67 } = {},
68) =>
69 DesktopLinuxUrlHandler.layer.pipe(
70 Layer.provide(
71 Layer.mergeAll(
72 Layer.effect(
73 DesktopEnvironment.DesktopEnvironment,
74 Path.Path.pipe(
75 Effect.map((path) => makeEnvironment(path, input.environment)),
76 Effect.provide(Path.layer),
77 ),
78 ),
79 Layer.succeed(DesktopAssets.DesktopAssets, {
80 iconPaths: Effect.succeed({
81 png: Option.fromUndefinedOr(input.iconSource),
82 ico: Option.none(),
83 icns: Option.none(),
84 }),
85 resolveResourcePath: () => Effect.succeedNone,
86 }),
87 FileSystem.layerNoop({
88 copyFile: (source, destination) =>
89 input.iconCopyError
90 ? Effect.fail(input.iconCopyError)
91 : Effect.sync(() => {
92 recorded.copies.push({ source, destination });
93 }),
94 readFileString: () => Effect.succeed(input.existingEntry ?? ""),
95 makeDirectory: (path) =>
96 Effect.sync(() => {
97 recorded.directories.push(path);
98 }),
99 writeFileString: (path, content) =>
100 input.writeError
101 ? Effect.fail(input.writeError)
102 : Effect.sync(() => {
103 recorded.files.push({ path, content });
104 }),
105 }),
106 Layer.succeed(
107 ChildProcessSpawner.ChildProcessSpawner,
108 ChildProcessSpawner.make((command) => {
109 const childProcess = command as unknown as {
110 readonly command: string;
111 readonly args: ReadonlyArray<string>;
112 };
113 if (childProcess.command === "update-desktop-database") {
114 assert.isTrue(
115 recorded.files.length > 0 || input.existingEntry !== undefined,
116 "the desktop entry must exist before refreshing the MIME cache",
117 );
118 }
119 recorded.commands.push({
120 command: childProcess.command,
121 args: childProcess.args,
122 });
123 const exitCode =
124 childProcess.command === "update-desktop-database"
125 ? (input.updateDesktopDatabaseExitCode ?? 0)
126 : (input.xdgMimeExitCode ?? 0);
127 const handle = mockProcess(
128 exitCode,
129 childProcess.command === "update-desktop-database" &&
130 input.updateDesktopDatabaseStalled === true,
131 );
132 return childProcess.command === "update-desktop-database" &&
133 input.updateDesktopDatabaseStarted
134 ? Deferred.succeed(input.updateDesktopDatabaseStarted, undefined).pipe(
135 Effect.as(handle),
136 )
137 : Effect.succeed(handle);
138 }),
139 ),
140 ),
141 ),
142 );
143
144const runRegister = (
145 recorded: RecordedRegistration,
146 input: Parameters<typeof layerHandler>[1] = {},
147) =>
148 Effect.gen(function* () {
149 const handler = yield* DesktopLinuxUrlHandler.DesktopLinuxUrlHandler;
150 yield* handler.register;
151 }).pipe(Effect.provide(layerHandler(recorded, input)));
152
153const emptyRecording = (): RecordedRegistration => ({
154 directories: [],
155 files: [],
156 commands: [],
157 copies: [],
158});
159
160describe("DesktopLinuxUrlHandler", () => {
161 it("renders a scheme-handler desktop entry with freedesktop Exec quoting", () => {
162 const entry = DesktopLinuxUrlHandler.renderUrlHandlerDesktopEntry({
163 displayName: "T3 Code (Nightly)",
164 execTarget: '/home/al ice/Apps/T3 "100%" $HOME\\x.AppImage',
165 scheme: "t3code",
166 iconPath: "/home/al ice/icons/T3\\x.png",
167 });
168
169 assert.include(entry, "[Desktop Entry]");
170 assert.include(entry, "Name=T3 Code (Nightly)");
171 assert.include(
172 entry,
173 'Exec="/home/al ice/Apps/T3 \\\\"100%%\\\\" \\\\$HOME\\\\\\\\x.AppImage" %U',
174 );
175 assert.include(entry, "NoDisplay=true");
176 assert.notInclude(entry, "StartupWMClass=");
177 assert.include(entry, "MimeType=x-scheme-handler/t3code;");
178 assert.include(entry, "Icon=/home/al ice/icons/T3\\\\x.png");
179 });
180
181 it.effect(
182 "writes the handler entry, refreshes the MIME cache, and claims the scheme default",
183 () => {
184 const recorded = emptyRecording();
185
186 return Effect.gen(function* () {
187 yield* runRegister(recorded);
188
189 assert.deepEqual(recorded.directories, ["/home/alice/.local/share/applications"]);
190 assert.equal(recorded.files.length, 1);
191 assert.equal(
192 recorded.files[0]?.path,
193 "/home/alice/.local/share/applications/com.t3tools.T3Code.desktop",
194 );
195 assert.include(
196 recorded.files[0]?.content,
197 "Exec=/home/alice/Applications/T3-Code.AppImage %U",
198 );
199 assert.include(recorded.files[0]?.content, "MimeType=x-scheme-handler/t3code;");
200 assert.deepEqual(recorded.commands, [
201 {
202 command: "update-desktop-database",
203 args: ["/home/alice/.local/share/applications"],
204 },
205 {
206 command: "xdg-mime",
207 args: ["default", "com.t3tools.T3Code.desktop", "x-scheme-handler/t3code"],
208 },
209 ]);
210 });
211 },
212 );
213
214 it.effect("falls back to the process executable outside an AppImage", () => {
215 const recorded = emptyRecording();
216
217 return Effect.gen(function* () {
218 yield* runRegister(recorded, { environment: { appImagePath: Option.none() } });
219
220 assert.include(
221 recorded.files[0]?.content,
222 DesktopLinuxUrlHandler.renderUrlHandlerDesktopEntry({
223 displayName: "T3 Code (Alpha)",
224 execTarget: process.execPath,
225 scheme: "t3code",
226 iconPath: "/home/alice/.local/share/icons/com.t3tools.T3Code.desktop.png",
227 }),
228 );
229 });
230 });
231
232 it.effect("launches a distribution package through its configured launcher", () => {
233 const recorded = emptyRecording();
234
235 return Effect.gen(function* () {
236 yield* runRegister(recorded, {
237 environment: { desktopLauncherPath: Option.some("/opt/T3 Code/t3code") },
238 });
239
240 assert.include(recorded.files[0]?.content, 'Exec="/opt/T3 Code/t3code" %U');
241 });
242 });
243
244 it.effect("does not rewrite the pre-ready entry while the portal can be reading it", () => {
245 const recorded = emptyRecording();
246
247 return Effect.gen(function* () {
248 yield* runRegister(recorded, {
249 existingEntry: DesktopLinuxUrlHandler.renderUrlHandlerDesktopEntry({
250 displayName: "T3 Code (Alpha)",
251 execTarget: "/home/alice/Applications/T3-Code.AppImage",
252 scheme: "t3code",
253 iconPath: "/home/alice/.local/share/icons/com.t3tools.T3Code.desktop.png",
254 }),
255 });
256
257 assert.deepEqual(recorded.files, []);
258 assert.deepEqual(recorded.directories, []);
259 assert.deepEqual(recorded.commands, [
260 {
261 command: "update-desktop-database",
262 args: ["/home/alice/.local/share/applications"],
263 },
264 {
265 command: "xdg-mime",
266 args: ["default", "com.t3tools.T3Code.desktop", "x-scheme-handler/t3code"],
267 },
268 ]);
269 });
270 });
271
272 it.effect("installs a persistent icon even when the desktop entry is already current", () => {
273 const recorded = emptyRecording();
274 const iconPath = "/home/alice/.local/share/icons/com.t3tools.T3Code.desktop.png";
275 return Effect.gen(function* () {
276 yield* runRegister(recorded, {
277 iconSource: "/tmp/.mount_T3/resources/icon.png",
278 existingEntry: DesktopLinuxUrlHandler.renderUrlHandlerDesktopEntry({
279 displayName: "T3 Code (Alpha)",
280 execTarget: "/home/alice/Applications/T3-Code.AppImage",
281 scheme: "t3code",
282 iconPath,
283 }),
284 });
285 assert.deepEqual(recorded.files, []);
286 assert.deepEqual(recorded.copies, [
287 { source: "/tmp/.mount_T3/resources/icon.png", destination: iconPath },
288 ]);
289 assert.equal(recorded.commands.at(-1)?.command, "xdg-mime");
290 });
291 });
292
293 it.effect("still registers the handler when copying its icon fails", () => {
294 const recorded = emptyRecording();
295 return Effect.gen(function* () {
296 yield* runRegister(recorded, {
297 iconSource: "/tmp/.mount_T3/resources/icon.png",
298 iconCopyError: PlatformError.systemError({
299 _tag: "PermissionDenied",
300 module: "FileSystem",
301 method: "copyFile",
302 description: "read-only icon directory",
303 }),
304 });
305 assert.equal(recorded.files.length, 1);
306 assert.deepEqual(
307 recorded.commands.map(({ command }) => command),
308 ["update-desktop-database", "xdg-mime"],
309 );
310 });
311 });
312
313 it.effect("writes the portal identity without claiming the URL scheme in development", () => {
314 const nonLinux = emptyRecording();
315 const unpackaged = emptyRecording();
316
317 return Effect.gen(function* () {
318 yield* runRegister(nonLinux, { environment: { platform: "darwin" } });
319 yield* runRegister(unpackaged, {
320 environment: {
321 isPackaged: false,
322 linuxDesktopEntryName: "com.t3tools.T3Code.Development.desktop",
323 },
324 });
325
326 assert.deepEqual(nonLinux.files, []);
327 assert.equal(
328 unpackaged.files[0]?.path,
329 "/home/alice/.local/share/applications/com.t3tools.T3Code.Development.desktop",
330 );
331 assert.deepEqual(unpackaged.commands, []);
332 });
333 });
334
335 it.effect("never fails startup when registration cannot complete", () => {
336 const desktopDatabaseFailed = emptyRecording();
337 const xdgMimeFailed = emptyRecording();
338 const writeFailed = emptyRecording();
339
340 return Effect.gen(function* () {
341 yield* runRegister(desktopDatabaseFailed, { updateDesktopDatabaseExitCode: 1 });
342 yield* runRegister(xdgMimeFailed, { xdgMimeExitCode: 1 });
343 yield* runRegister(writeFailed, {
344 writeError: PlatformError.systemError({
345 _tag: "PermissionDenied",
346 module: "FileSystem",
347 method: "writeFileString",
348 description: "read-only filesystem",
349 pathOrDescriptor: "/home/alice/.local/share/applications/com.t3tools.T3Code.desktop",
350 }),
351 });
352
353 assert.deepEqual(
354 desktopDatabaseFailed.commands.map(({ command }) => command),
355 ["update-desktop-database", "xdg-mime"],
356 );
357 assert.equal(xdgMimeFailed.files.length, 1);
358 assert.deepEqual(writeFailed.commands, []);
359 });
360 });
361});
362
363interface ThemeIconRun {
364 readonly root: string;
365 readonly commands: Array<{ readonly command: string; readonly args: ReadonlyArray<string> }>;
366 readonly iconCacheOptions?: Array<Record<string, unknown>>;
367 readonly sourceMissing?: boolean;
368 readonly iconCacheExitCode?: number;
369 readonly iconCacheSpawnFails?: boolean;
370 readonly iconCacheStalled?: boolean;
371 readonly iconCacheStarted?: Deferred.Deferred<void>;
372 // Stands in for gtk-update-icon-cache rewriting the cache on success.
373 readonly onIconCacheRefresh?: Effect.Effect<void>;
374}
375
376const registerWithRealFileSystem = (run: ThemeIconRun) =>
377 Effect.gen(function* () {
378 const handler = yield* DesktopLinuxUrlHandler.DesktopLinuxUrlHandler;
379 yield* handler.register;
380 }).pipe(
381 Effect.provide(
382 DesktopLinuxUrlHandler.layer.pipe(
383 Layer.provide(
384 Layer.mergeAll(
385 Layer.effect(
386 DesktopEnvironment.DesktopEnvironment,
387 Path.Path.pipe(
388 Effect.map((path) =>
389 makeEnvironment(path, {
390 linuxApplicationsDir: path.join(run.root, "applications"),
391 }),
392 ),
393 ),
394 ),
395 Layer.effect(
396 DesktopAssets.DesktopAssets,
397 Path.Path.pipe(
398 Effect.map((path) => ({
399 iconPaths: Effect.succeed({
400 png: Option.none(),
401 ico: Option.none(),
402 icns: Option.none(),
403 }),
404 resolveResourcePath: (fileName: string) =>
405 Effect.succeed(
406 fileName === "icons/256x256.png"
407 ? Option.some(
408 path.join(
409 run.root,
410 run.sourceMissing ? "missing" : "resources",
411 fileName,
412 ),
413 )
414 : Option.none(),
415 ),
416 })),
417 ),
418 ),
419 Layer.succeed(
420 ChildProcessSpawner.ChildProcessSpawner,
421 ChildProcessSpawner.make((command) => {
422 const childProcess = command as unknown as {
423 readonly command: string;
424 readonly args: ReadonlyArray<string>;
425 };
426 run.commands.push({ command: childProcess.command, args: childProcess.args });
427 if (childProcess.command !== "gtk-update-icon-cache") {
428 return Effect.succeed(mockProcess(0));
429 }
430 run.iconCacheOptions?.push(
431 (command as unknown as { readonly options: Record<string, unknown> }).options,
432 );
433 if (run.iconCacheSpawnFails) {
434 return Effect.fail(
435 PlatformError.systemError({
436 _tag: "NotFound",
437 module: "ChildProcess",
438 method: "spawn",
439 description: "gtk-update-icon-cache is not installed",
440 }),
441 );
442 }
443 const exitCode = run.iconCacheExitCode ?? 0;
444 const handle = mockProcess(exitCode, run.iconCacheStalled === true);
445 const refreshed =
446 exitCode === 0 && run.onIconCacheRefresh ? run.onIconCacheRefresh : Effect.void;
447 return refreshed.pipe(
448 Effect.andThen(
449 run.iconCacheStarted
450 ? Deferred.succeed(run.iconCacheStarted, undefined)
451 : Effect.void,
452 ),
453 Effect.as(handle),
454 );
455 }),
456 ),
457 ),
458 ),
459 ),
460 ),
461 );
462
463const themeIconFixture = (source: Uint8Array) =>
464 Effect.gen(function* () {
465 const fileSystem = yield* FileSystem.FileSystem;
466 const path = yield* Path.Path;
467 const root = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-theme-icons-" });
468 yield* fileSystem.makeDirectory(path.join(root, "resources", "icons"), { recursive: true });
469 yield* fileSystem.writeFile(path.join(root, "resources", "icons", "256x256.png"), source);
470 const hicolorDir = path.join(root, "icons", "hicolor");
471 const appsDir = path.join(hicolorDir, "256x256", "apps");
472 const cachePath = path.join(hicolorDir, "icon-theme.cache");
473 const pastSeconds = 1_600_000_000;
474 const seedCache = Effect.gen(function* () {
475 yield* fileSystem.makeDirectory(appsDir, { recursive: true });
476 yield* fileSystem.writeFile(cachePath, new Uint8Array([0]));
477 yield* fileSystem.utimes(cachePath, pastSeconds, pastSeconds);
478 });
479 const rewriteCache = fileSystem
480 .writeFile(cachePath, new Uint8Array([1]))
481 .pipe(Effect.orDie, Effect.provideService(FileSystem.FileSystem, fileSystem));
482 return { root, hicolorDir, appsDir, cachePath, pastSeconds, seedCache, rewriteCache };
483 });
484
485const iconCacheRuns = (run: ThemeIconRun) =>
486 run.commands.filter(({ command }) => command === "gtk-update-icon-cache").length;
487
488it.layer(NodeServices.layer)("DesktopLinuxUrlHandler theme icons", (it) => {
489 it.effect("installs both app id spellings without creating an icon cache", () =>
490 Effect.gen(function* () {
491 const fileSystem = yield* FileSystem.FileSystem;
492 const path = yield* Path.Path;
493 const icon = new Uint8Array([137, 80, 78, 71, 1, 2, 3]);
494 const fixture = yield* themeIconFixture(icon);
495 const run: ThemeIconRun = { root: fixture.root, commands: [] };
496
497 yield* registerWithRealFileSystem(run);
498 assert.deepEqual([...(yield* fileSystem.readDirectory(fixture.appsDir))].sort(), [
499 "com.t3tools.T3Code.png",
500 "com.t3tools.t3code.png",
501 ]);
502 for (const name of ["com.t3tools.t3code", "com.t3tools.T3Code"]) {
503 const target = path.join(fixture.appsDir, `${name}.png`);
504 assert.deepEqual([...(yield* fileSystem.readFile(target))], [...icon]);
505 yield* fileSystem.utimes(target, fixture.pastSeconds, fixture.pastSeconds);
506 }
507
508 yield* registerWithRealFileSystem(run);
509 for (const name of ["com.t3tools.t3code", "com.t3tools.T3Code"]) {
510 const info = yield* fileSystem.stat(path.join(fixture.appsDir, `${name}.png`));
511 assert.equal(Option.getOrThrow(info.mtime).getTime(), fixture.pastSeconds * 1000);
512 }
513 assert.isFalse(yield* fileSystem.exists(fixture.cachePath));
514 assert.equal(iconCacheRuns(run), 0);
515 }).pipe(Effect.scoped),
516 );
517
518 it.effect("replaces same-length stale icons and refreshes an existing cache once", () =>
519 Effect.gen(function* () {
520 const fileSystem = yield* FileSystem.FileSystem;
521 const path = yield* Path.Path;
522 const fixture = yield* themeIconFixture(new Uint8Array([1, 2, 3]));
523 yield* fixture.seedCache;
524 const lower = path.join(fixture.appsDir, "com.t3tools.t3code.png");
525 const upper = path.join(fixture.appsDir, "com.t3tools.T3Code.png");
526 yield* fileSystem.writeFile(lower, new Uint8Array([3, 2, 1]));
527 yield* fileSystem.writeFile(upper, new Uint8Array([1, 2, 3]));
528 for (const target of [lower, upper]) {
529 yield* fileSystem.utimes(target, fixture.pastSeconds, fixture.pastSeconds);
530 }
531 const run: ThemeIconRun = {
532 root: fixture.root,
533 commands: [],
534 onIconCacheRefresh: fixture.rewriteCache,
535 };
536
537 yield* registerWithRealFileSystem(run);
538 yield* registerWithRealFileSystem(run);
539
540 assert.deepEqual([...(yield* fileSystem.readFile(lower))], [1, 2, 3]);
541 const upperInfo = yield* fileSystem.stat(upper);
542 assert.equal(Option.getOrThrow(upperInfo.mtime).getTime(), fixture.pastSeconds * 1000);
543 assert.deepEqual(
544 run.commands.filter(({ command }) => command === "gtk-update-icon-cache"),
545 [{ command: "gtk-update-icon-cache", args: ["-f", "-t", fixture.hicolorDir] }],
546 );
547 }).pipe(Effect.scoped),
548 );
549
550 it.effect("refreshes when this launch changed an icon even if the cache looks newer", () =>
551 Effect.gen(function* () {
552 const fileSystem = yield* FileSystem.FileSystem;
553 const path = yield* Path.Path;
554 const fixture = yield* themeIconFixture(new Uint8Array([1, 2, 3]));
555 yield* fixture.seedCache;
556 const run: ThemeIconRun = {
557 root: fixture.root,
558 commands: [],
559 onIconCacheRefresh: fixture.rewriteCache,
560 };
561 const future = fixture.pastSeconds + 10 * 365 * 24 * 60 * 60;
562 yield* fileSystem.utimes(fixture.cachePath, future, future);
563
564 yield* registerWithRealFileSystem(run);
565
566 assert.isTrue(yield* fileSystem.exists(path.join(fixture.appsDir, "com.t3tools.T3Code.png")));
567 assert.equal(iconCacheRuns(run), 1);
568 }).pipe(Effect.scoped),
569 );
570
571 it.effect("retries a failed icon cache refresh on the next launch", () =>
572 Effect.gen(function* () {
573 const fixture = yield* themeIconFixture(new Uint8Array([1, 2, 3]));
574 yield* fixture.seedCache;
575 const failing: ThemeIconRun = { root: fixture.root, commands: [], iconCacheExitCode: 1 };
576 yield* registerWithRealFileSystem(failing);
577 assert.equal(iconCacheRuns(failing), 1);
578 assert.deepEqual(failing.commands.map(({ command }) => command).slice(1), [
579 "update-desktop-database",
580 "xdg-mime",
581 ]);
582
583 const recovering: ThemeIconRun = {
584 root: fixture.root,
585 commands: [],
586 onIconCacheRefresh: fixture.rewriteCache,
587 };
588 yield* registerWithRealFileSystem(recovering);
589 yield* registerWithRealFileSystem(recovering);
590 assert.equal(iconCacheRuns(recovering), 1);
591 }).pipe(Effect.scoped),
592 );
593
594 it.effect("still registers the handler when the theme icon install fails", () =>
595 Effect.gen(function* () {
596 const fixture = yield* themeIconFixture(new Uint8Array([1, 2, 3]));
597 const missingSource: ThemeIconRun = { root: fixture.root, commands: [], sourceMissing: true };
598 yield* registerWithRealFileSystem(missingSource);
599 assert.deepEqual(
600 missingSource.commands.map(({ command }) => command),
601 ["update-desktop-database", "xdg-mime"],
602 );
603
604 yield* fixture.seedCache;
605 const missingTool: ThemeIconRun = {
606 root: fixture.root,
607 commands: [],
608 iconCacheSpawnFails: true,
609 };
610 yield* registerWithRealFileSystem(missingTool);
611 assert.deepEqual(
612 missingTool.commands.map(({ command }) => command),
613 ["gtk-update-icon-cache", "update-desktop-database", "xdg-mime"],
614 );
615 }).pipe(Effect.scoped),
616 );
617});