Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/desktop/src/app/DesktopClerk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ it.effect.each(["startup", "open-url", "early-second-instance"] as const)(
),
Effect.provideService(DesktopWebLinks.DesktopWebLinks, ignoreWebLinks),
);
}).pipe(Effect.scoped),
}),
);

it.effect("hands web and app links to the renderer and leaves other links alone", () =>
Expand Down Expand Up @@ -481,5 +481,5 @@ it.effect("hands web and app links to the renderer and leaves other links alone"
}),
),
);
}).pipe(Effect.scoped),
}),
);
16 changes: 8 additions & 8 deletions apps/desktop/src/app/DesktopCliCommand.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
expect(yield* fs.exists(upgradedLink)).toBe(false);
expect((yield* upgraded.install).installedPath).toBe(upgradedLink);
}
}).pipe(Effect.scoped),
}),
);

it.effect("never replaces or removes a t3 it did not create", () =>
Expand Down Expand Up @@ -202,7 +202,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
expect((yield* Effect.flip(command.install)).message).toContain("Could not set up");
yield* command.uninstall;
expect(yield* fs.readFileString(launcher)).toBe("npm's t3\n");
}).pipe(Effect.scoped),
}),
);

it.effect("finds and removes a link left by a previous T3 home", () =>
Expand Down Expand Up @@ -259,7 +259,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
);
expect(yield* fs.exists(path.join(home, ".local", "bin", "t3"))).toBe(false);
expect(yield* fs.readFileString(path.join(home, "bin", "t3.staging"))).toBe("mine");
}).pipe(Effect.scoped),
}),
);

it.effect("refuses to install behind another t3 that runs first", () =>
Expand Down Expand Up @@ -309,7 +309,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
installedPath: path.join(home, ".local", "bin", "t3"),
});
expect(installed.shadowedBy).toBeUndefined();
}).pipe(Effect.scoped),
}),
);

it.effect.skipIf(HostProcess.Platform.defaultValue() === "win32")(
Expand Down Expand Up @@ -343,7 +343,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
onPath: true,
installedPath: path.join(home, ".local", "bin", "t3"),
});
}).pipe(Effect.scoped),
}),
);

it.effect("does not treat its own launcher as another t3 when its folder is first on PATH", () =>
Expand Down Expand Up @@ -372,7 +372,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
expect(yield* command.state).toEqual(removed);
expect(yield* fs.exists(installed.installedPath!)).toBe(false);
expect(yield* fs.exists(launcher)).toBe(true);
}).pipe(Effect.scoped),
}),
);

it.effect("leaves the Windows PATH alone when it cannot be read", () =>
Expand Down Expand Up @@ -411,7 +411,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
const reader = yield* commandIn({ home, platform: "win32" }, inherited.spawner);
yield* reader.install;
expect(inherited.registry).toMatchObject({ path: `${userPath};${launcherDir}`, writes: 1 });
}).pipe(Effect.scoped),
}),
);

it.effect("does not claim or remove a Windows PATH entry the user added", () =>
Expand Down Expand Up @@ -441,6 +441,6 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
yield* (yield* commandIn({ home: besideHome, platform: "win32" }, beside.spawner))
.installOnFirstLaunch;
expect(beside.registry).toMatchObject({ path: "C:\\Tools", writes: 0 });
}).pipe(Effect.scoped),
}),
);
});
4 changes: 2 additions & 2 deletions apps/desktop/src/app/DesktopConnectionCatalogStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const withStore = <A, E, R>(
prefix: "t3-desktop-connection-catalog-test-",
});
return yield* effect.pipe(Effect.provide(layerFor(baseDir, encryptionAvailable)));
}).pipe(Effect.provide(NodeServices.layer), Effect.scoped);
}).pipe(Effect.provide(NodeServices.layer));

describe("DesktopConnectionCatalogStore", () => {
it.effect("persists and reads an encrypted connection catalog", () =>
Expand Down Expand Up @@ -298,6 +298,6 @@ describe("DesktopConnectionCatalogStore", () => {
assert.notEqual(error.message, decryptError.message);
yield* Ref.set(failDecrypt, false);
assert.deepStrictEqual(yield* store.get, Option.some('{"schemaVersion":1,"targets":[]}'));
}).pipe(Effect.provide(NodeServices.layer), Effect.scoped),
}).pipe(Effect.provide(NodeServices.layer)),
);
});
10 changes: 5 additions & 5 deletions apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ it.layer(NodeServices.layer)("DesktopLinuxUrlHandler theme icons", (it) => {
}
assert.isFalse(yield* fileSystem.exists(fixture.cachePath));
assert.equal(iconCacheRuns(run), 0);
}).pipe(Effect.scoped),
}),
);

it.effect("replaces same-length stale icons and refreshes an existing cache once", () =>
Expand Down Expand Up @@ -634,7 +634,7 @@ it.layer(NodeServices.layer)("DesktopLinuxUrlHandler theme icons", (it) => {
run.commands.filter(({ command }) => command === "gtk-update-icon-cache"),
[{ command: "gtk-update-icon-cache", args: ["-f", "-t", fixture.hicolorDir] }],
);
}).pipe(Effect.scoped),
}),
);

it.effect("refreshes when this launch changed an icon even if the cache looks newer", () =>
Expand All @@ -655,7 +655,7 @@ it.layer(NodeServices.layer)("DesktopLinuxUrlHandler theme icons", (it) => {

assert.isTrue(yield* fileSystem.exists(path.join(fixture.appsDir, "com.t3tools.T3Code.png")));
assert.equal(iconCacheRuns(run), 1);
}).pipe(Effect.scoped),
}),
);

it.effect("retries a failed icon cache refresh on the next launch", () =>
Expand All @@ -678,7 +678,7 @@ it.layer(NodeServices.layer)("DesktopLinuxUrlHandler theme icons", (it) => {
yield* registerWithRealFileSystem(recovering);
yield* registerWithRealFileSystem(recovering);
assert.equal(iconCacheRuns(recovering), 1);
}).pipe(Effect.scoped),
}),
);

it.effect("still registers the handler when the theme icon install fails", () =>
Expand All @@ -702,6 +702,6 @@ it.layer(NodeServices.layer)("DesktopLinuxUrlHandler theme icons", (it) => {
missingTool.commands.map(({ command }) => command),
["gtk-update-icon-cache", "update-desktop-database", "xdg-mime"],
);
}).pipe(Effect.scoped),
}),
);
});
Loading
Loading