Skip to content
Merged
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
6 changes: 4 additions & 2 deletions tests/libs/sessionDescriptor.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,14 +42,16 @@ describe("sessionDescriptor", () => {

test("descriptorPath resolves against the config manager folder", () => {
const fake = {getFilePath: (n: string) => path.join("/home/x/.genlayer", n)} as any;
expect(descriptorPath(fake)).toBe("/home/x/.genlayer/wallet-session.json");
expect(descriptorPath(fake)).toBe(path.join("/home/x/.genlayer", "wallet-session.json"));
});

test("writeDescriptor writes 0600 and readDescriptor round-trips", () => {
const d = makeDescriptor();
writeDescriptor(file, d);
const mode = fs.statSync(file).mode & 0o777;
expect(mode).toBe(0o600);
if (process.platform !== "win32") {
expect(mode).toBe(0o600);
}
expect(readDescriptor(file)).toEqual(d);
// No leftover temp file.
expect(fs.existsSync(`${file}.tmp`)).toBe(false);
Expand Down
Loading