Skip to content

Commit 6dde0a6

Browse files
atkgithub-actions[bot]
authored andcommitted
Format
1 parent 96a1ebd commit 6dde0a6

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

packages/filesystem/test/index.test.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe("makeVirtualFileSystem", () => {
5959
expect(() => fs.readFile("src/nonexistent.ts")).toThrow('"src/nonexistent.ts" is not a file');
6060
});
6161
test("fs.readFile throws on attempting to read from a non-existing directory", () => {
62-
expect(() => fs.readFile("nonexistent/test.ts")).toThrow('"nonexistent" is not a directory')
62+
expect(() => fs.readFile("nonexistent/test.ts")).toThrow('"nonexistent" is not a directory');
6363
});
6464
test("fs.writeFile creates and overwrites file", () => {
6565
expect(fs.readdir("src")).toHaveLength(1);
@@ -125,17 +125,21 @@ describe("createFileSystem (sync) calls the underlying fs", () => {
125125
});
126126

127127
describe("createFileSystem (sync) relays file system errors", () => {
128-
test("a deleted file stored in a signal throws an error", () => new Promise<void>((done, fail) => {
129-
setTimeout(() => fail(new Error('did not throw')), 100);
130-
const fs = createFileSystem(makeVirtualFileSystem({ 'test.json': '{}' }));
131-
catchError(() => {
132-
createEffect(() => fs.readFile("test.json"));
133-
setTimeout(() => fs.rm("test.json"), 30);
134-
}, (error) => {
135-
expect(error).toEqual(new Error('"test.json" is not a file'));
136-
done();
137-
});
138-
}));
128+
test("a deleted file stored in a signal throws an error", () =>
129+
new Promise<void>((done, fail) => {
130+
setTimeout(() => fail(new Error("did not throw")), 100);
131+
const fs = createFileSystem(makeVirtualFileSystem({ "test.json": "{}" }));
132+
catchError(
133+
() => {
134+
createEffect(() => fs.readFile("test.json"));
135+
setTimeout(() => fs.rm("test.json"), 30);
136+
},
137+
error => {
138+
expect(error).toEqual(new Error('"test.json" is not a file'));
139+
done();
140+
},
141+
);
142+
}));
139143
});
140144

141145
describe("createFileSystem (async) calls the underlying fs", () => {

0 commit comments

Comments
 (0)