mirror of
https://github.com/morten-olsen/http.md.git
synced 2026-02-08 00:46:28 +01:00
test: add initial testing and linting (#18)
This commit is contained in:
23
tests/execute.test.ts
Normal file
23
tests/execute.test.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { resolve } from 'path';
|
||||
|
||||
import { describe, it, expect, beforeAll, afterEach, afterAll } from 'vitest';
|
||||
|
||||
import { Context, execute } from '../src/exports.js';
|
||||
|
||||
import { server } from './mocks/node.js';
|
||||
|
||||
describe('execute', () => {
|
||||
beforeAll(() => server.listen());
|
||||
afterEach(() => server.resetHandlers());
|
||||
afterAll(() => server.close());
|
||||
|
||||
it('should correctly render the readme file', async () => {
|
||||
const context = new Context();
|
||||
const filePath = resolve(__dirname, '..', 'docs', 'README.md');
|
||||
const result = await execute(filePath, {
|
||||
context,
|
||||
});
|
||||
|
||||
expect(result.markdown).toMatchSnapshot();
|
||||
}, 30000);
|
||||
});
|
||||
Reference in New Issue
Block a user