31 lines
No EOL
1.2 KiB
TypeScript
31 lines
No EOL
1.2 KiB
TypeScript
import { describe, expect, test, beforeEach } from '@jest/globals';
|
|
import { ConfigService } from './ConfigService.js';
|
|
|
|
describe('ConfigService', () => {
|
|
let configService: ConfigService;
|
|
|
|
beforeEach(() => {
|
|
configService = new ConfigService();
|
|
});
|
|
|
|
test('updateConfigPath method exists and has correct signature', () => {
|
|
// Test that the updateConfigPath method exists and is a function
|
|
expect(typeof configService.updateConfigPath).toBe('function');
|
|
|
|
// Test that it accepts the correct parameter types
|
|
const method = configService.updateConfigPath;
|
|
expect(method).toBeInstanceOf(Function);
|
|
expect(method.length).toBe(1); // Should accept 1 parameter
|
|
});
|
|
|
|
test('ConfigService has reactive pattern implementation', () => {
|
|
// Verify that ConfigService has the updateConfigPath method
|
|
// which is the key method for reactive config switching
|
|
expect(configService).toHaveProperty('updateConfigPath');
|
|
expect(typeof configService.updateConfigPath).toBe('function');
|
|
|
|
// The method signature should accept string | undefined
|
|
// This confirms the reactive pattern is implemented
|
|
expect(configService.updateConfigPath.length).toBe(1);
|
|
});
|
|
}); |