Buckets:
| import { describe, expect, test } from "bun:test" | |
| import { createRefreshQueue } from "./queue" | |
| import { directoryKey } from "./utils" | |
| const tick = () => new Promise((resolve) => setTimeout(resolve, 10)) | |
| describe("createRefreshQueue", () => { | |
| test("clears queued directories by normalized key", async () => { | |
| const calls: string[] = [] | |
| const queue = createRefreshQueue({ | |
| paused: () => false, | |
| key: directoryKey, | |
| bootstrap: async () => {}, | |
| bootstrapInstance: (directory) => { | |
| calls.push(directory) | |
| }, | |
| }) | |
| queue.push("C:\\tmp\\demo") | |
| queue.clear("C:/tmp/demo") | |
| await tick() | |
| expect(calls).toEqual([]) | |
| queue.dispose() | |
| }) | |
| test("passes the original directory to bootstrapInstance", async () => { | |
| const calls: string[] = [] | |
| const queue = createRefreshQueue({ | |
| paused: () => false, | |
| key: directoryKey, | |
| bootstrap: async () => {}, | |
| bootstrapInstance: (directory) => { | |
| calls.push(directory) | |
| }, | |
| }) | |
| queue.push("C:\\tmp\\demo") | |
| await tick() | |
| expect(calls).toEqual(["C:\\tmp\\demo"]) | |
| queue.dispose() | |
| }) | |
| }) | |
Xet Storage Details
- Size:
- 1.14 kB
- Xet hash:
- 7db30bb615f9456ec6d3f60cd569ab4b924593983b00ca32855cd727ba0dd489
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.