* Build a stat adapter from a path → kind map. Throws ENOENT for any * path not in the map, matching `statSync` behaviour.
(entries: Record<string, "file" | "directory">)
| 36 | * path not in the map, matching `statSync` behaviour. |
| 37 | */ |
| 38 | function makeStat(entries: Record<string, "file" | "directory">): (path: string) => Stats { |
| 39 | return (path) => { |
| 40 | const kind = entries[path]; |
| 41 | if (!kind) { |
| 42 | const err = new Error(`ENOENT: no such file or directory, stat '${path}'`); |
| 43 | (err as NodeJS.ErrnoException).code = "ENOENT"; |
| 44 | throw err; |
| 45 | } |
| 46 | return fakeStats(kind); |
| 47 | }; |
| 48 | } |
| 49 | |
| 50 | describe("parseBrowserTimeoutMsArg", () => { |
| 51 | it("returns undefined when the flag is absent", () => { |
no test coverage detected