core tests

This commit is contained in:
2026-01-24 12:18:31 +01:00
parent 3bef15f3bd
commit 5da14b1b21
15 changed files with 809 additions and 312 deletions

View File

@@ -0,0 +1,20 @@
import { describe, it, expect } from 'vitest';
import { DriverNotFoundError } from './DriverNotFoundError';
describe('DriverNotFoundError', () => {
it('should create an error with the correct message and properties', () => {
const driverId = 'driver-123';
const error = new DriverNotFoundError(driverId);
expect(error.message).toBe(`Driver with ID "${driverId}" not found`);
expect(error.name).toBe('DriverNotFoundError');
expect(error.type).toBe('domain');
expect(error.context).toBe('dashboard');
expect(error.kind).toBe('not_found');
});
it('should be an instance of Error', () => {
const error = new DriverNotFoundError('123');
expect(error).toBeInstanceOf(Error);
});
});