Every path `realpathSync` is asked about from here on.
()
| 25 | |
| 26 | /** Every path `realpathSync` is asked about from here on. */ |
| 27 | function recordRealpaths(): string[] { |
| 28 | const real = fs.realpathSync; |
| 29 | const asked: string[] = []; |
| 30 | vi.spyOn(fs, 'realpathSync').mockImplementation(((p: fs.PathLike, ...rest: []) => { |
| 31 | asked.push(String(p)); |
| 32 | return real(p, ...rest); |
| 33 | }) as typeof fs.realpathSync); |
| 34 | Object.assign(fs.realpathSync, { native: real.native }); |
| 35 | return asked; |
| 36 | } |
| 37 | |
| 38 | afterEach(() => { |
| 39 | vi.restoreAllMocks(); |
no test coverage detected