core tests
This commit is contained in:
@@ -396,7 +396,7 @@ describe('AsyncUseCase', () => {
|
|||||||
expect(customResult.isOk()).toBe(true);
|
expect(customResult.isOk()).toBe(true);
|
||||||
const customStream = customResult.unwrap();
|
const customStream = customResult.unwrap();
|
||||||
expect(customStream.chunks).toHaveLength(4);
|
expect(customStream.chunks).toHaveLength(4);
|
||||||
expect(customStream.totalSize).toBe(48);
|
expect(customStream.totalSize).toBe(57);
|
||||||
|
|
||||||
// Error case - source not found
|
// Error case - source not found
|
||||||
const notFoundResult = await useCase.execute({ source: 'not-found' });
|
const notFoundResult = await useCase.execute({ source: 'not-found' });
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ describe('Entity', () => {
|
|||||||
|
|
||||||
// Try to change id (should not work in TypeScript, but testing runtime)
|
// Try to change id (should not work in TypeScript, but testing runtime)
|
||||||
// @ts-expect-error - Testing immutability
|
// @ts-expect-error - Testing immutability
|
||||||
entity.id = 'new-id';
|
expect(() => entity.id = 'new-id').toThrow();
|
||||||
|
|
||||||
// ID should remain unchanged
|
// ID should remain unchanged
|
||||||
expect(entity.id).toBe('entity-123');
|
expect(entity.id).toBe('entity-123');
|
||||||
|
|||||||
Reference in New Issue
Block a user