mirror of
https://github.com/geoffsee/open-gsio.git
synced 2025-09-08 22:56:46 +00:00
add server test suite
This commit is contained in:
16
workers/site/__tests__/api-router.test.ts
Normal file
16
workers/site/__tests__/api-router.test.ts
Normal 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');
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user