import { describe, test, expect } from 'bun:test'; import { FileMediaStore } from '../src/server.js'; describe('FileMediaStore', () => { test('a directory it cannot use fails each call with the reason, not the process', async () => { const store = new FileMediaStore('/proc/shade-cannot-write-here'); await new Promise((r) => setTimeout(r, 20)); // an unhandled rejection would surface here await expect(store.get('00'.repeat(16))).rejects.toThrow(/ENOENT|EACCES|EROFS|EPERM/); await expect(store.totalBytes()).rejects.toThrow(); }); });