import { describe, it, expect } from 'vitest';
import { EntityBuilder } from '../../../tests/helpers/entityBuilder.js';
class CounterBuilder extends EntityBuilder {
    constructor() {
        super({ value: 0 });
    }
    build() {
        return { value: this.props.value };
    }
    withValue(value) {
        this.props.value = value;
        return this;
    }
}
describe('EntityBuilder', () => {
    it('builds a single entity with the default props', () => {
        const entity = new CounterBuilder().build();
        expect(entity).toEqual({ value: 0 });
    });
    it('supports fluent overrides via subclass methods', () => {
        const entity = new CounterBuilder().withValue(42).build();
        expect(entity).toEqual({ value: 42 });
    });
    it('builds many entities and produces independent instances', () => {
        const builder = new CounterBuilder().withValue(7);
        const entities = builder.buildMany(3);
        expect(entities).toHaveLength(3);
        expect(entities.every(entity => entity.value === 7)).toBe(true);
        expect(entities[0]).not.toBe(entities[1]);
    });
});
//# sourceMappingURL=entityBuilder.test.js.map