add server test suite

This commit is contained in:
geoffsee
2025-05-31 19:36:13 -04:00
parent 3cf7ceb868
commit 810c562f86
5 changed files with 371 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
import { describe, it, expect, vi } from 'vitest';
import { createRouter } from '../api-router';
// Mock the vike/server module
vi.mock('vike/server', () => ({
renderPage: vi.fn()
}));
describe('api-router', () => {
// Test that the router is created successfully
it('creates a router', () => {
const router = createRouter();
expect(router).toBeDefined();
expect(typeof router.handle).toBe('function');
});
});