This commit is contained in:
2025-12-17 00:33:13 +01:00
parent 8c67081953
commit f01e01e50c
186 changed files with 9242 additions and 1342 deletions

View File

@@ -0,0 +1,30 @@
import { describe, it, expect } from 'vitest';
import { Points } from './Points';
describe('Points', () => {
it('should create points', () => {
const points = Points.create(100);
expect(points.toNumber()).toBe(100);
});
it('should create zero points', () => {
const points = Points.create(0);
expect(points.toNumber()).toBe(0);
});
it('should not create negative points', () => {
expect(() => Points.create(-1)).toThrow('Points cannot be negative');
});
it('should equal same points', () => {
const p1 = Points.create(50);
const p2 = Points.create(50);
expect(p1.equals(p2)).toBe(true);
});
it('should not equal different points', () => {
const p1 = Points.create(50);
const p2 = Points.create(51);
expect(p1.equals(p2)).toBe(false);
});
});