Fix/post list excerpt rendering (#41)
* feat: use excerpts in post lists * chore: made testing less noisy --------- Co-authored-by: hugo <hugoms@me.com>
This commit is contained in:
17
tests/utils/consoleCapture.test.ts
Normal file
17
tests/utils/consoleCapture.test.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { withCapturedConsole } from './consoleCapture';
|
||||
|
||||
describe('withCapturedConsole', () => {
|
||||
it('captures expected console output without leaking it to the test run', async () => {
|
||||
await withCapturedConsole('error', async (captured) => {
|
||||
const error = new Error('expected failure');
|
||||
|
||||
console.error('[Test]', error);
|
||||
|
||||
expect(captured.spy).toHaveBeenCalledWith('[Test]', error);
|
||||
expect(captured.text()).toContain('[Test]');
|
||||
expect(captured.text()).toContain('expected failure');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user