-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.test.ts
More file actions
36 lines (31 loc) · 1.16 KB
/
plugin.test.ts
File metadata and controls
36 lines (31 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { describe, it, expect } from 'vitest';
import bogowareTheme from './index.js';
describe('bogowareTheme plugin', () => {
it('should return a valid Starlight plugin object', () => {
const plugin = bogowareTheme({ mode: 'architect' });
expect(plugin.name).toBe('@bogoware/starlight-theme');
expect(plugin.hooks).toBeDefined();
expect(typeof plugin.hooks.setup).toBe('function');
});
it('should accept empty config (all defaults)', () => {
const plugin = bogowareTheme();
expect(plugin.name).toBe('@bogoware/starlight-theme');
});
it('should accept florentine mode', () => {
const plugin = bogowareTheme({ mode: 'florentine' });
expect(plugin.name).toBe('@bogoware/starlight-theme');
});
it('should accept styleRoutes config', () => {
const plugin = bogowareTheme({
mode: 'architect',
styleRoutes: [
{ pattern: 'blog/**', style: 'florentine' },
],
});
expect(plugin.name).toBe('@bogoware/starlight-theme');
});
it('should throw on invalid config', () => {
// @ts-expect-error — intentionally passing invalid config
expect(() => bogowareTheme({ mode: 'gothic' })).toThrow();
});
});