updates
This commit is contained in:
parent
5d771eed1b
commit
5368464042
28 changed files with 887 additions and 187 deletions
|
|
@ -34,6 +34,37 @@ test('every card has its own test', () => {
|
|||
assert.deepEqual(pool.all.map((c) => c.name).filter((n) => !tested.has(n)), []);
|
||||
});
|
||||
|
||||
test('set 2 loads on request, is well formed, and is unscripted', () => {
|
||||
const two = loadCards(undefined, [2]);
|
||||
const count = (kind: string) => two.all.filter((c) => c.kind === kind).length;
|
||||
assert.equal(count('avatar'), 12);
|
||||
assert.equal(count('server'), 7);
|
||||
assert.equal(count('program'), 17);
|
||||
assert.equal(count('hardware'), 8);
|
||||
assert.equal(count('execution'), 8);
|
||||
for (const c of two.all) {
|
||||
assert.equal(c.set, 2, c.name);
|
||||
assert.ok(!pool.byName.has(c.name), `${c.name} clashes with a set 1 card`);
|
||||
assert.ok(c.text || c.ability, `${c.name} has text`);
|
||||
if (c.kind === 'avatar') {
|
||||
assert.equal(c.cores + c.slots, 6, `${c.name}: Cores + Slots = 6`);
|
||||
assert.equal(c.health, { 4: 9, 3: 10, 2: 12 }[c.cores], `${c.name}: Health by Cores`);
|
||||
assert.ok(c.type && c.ability && c.ability.cost >= 3 && c.ability.cost <= 5, `${c.name}: typed, Ability 3-5 RAM`);
|
||||
} else if (c.kind === 'program') {
|
||||
assert.ok(c.type && c.ram >= 4 && c.ram <= 6, `${c.name}: typed, 4-6 RAM`);
|
||||
} else if (c.kind === 'execution') {
|
||||
assert.ok(c.ram >= 3 && c.ram <= 5, `${c.name}: 3-5 RAM`);
|
||||
} else if (c.kind === 'hardware') {
|
||||
assert.ok(c.ram >= 4 && c.ram <= 7, `${c.name}: 4-7 RAM`);
|
||||
}
|
||||
}
|
||||
const all = loadCards(undefined, 'all');
|
||||
assert.equal(all.all.length, pool.all.length + two.all.length);
|
||||
const warnings = staleScripts(all);
|
||||
assert.equal(warnings.length, two.all.length, 'one warning per set 2 card');
|
||||
assert.ok(warnings.every((w) => w.endsWith('no script yet')), 'the only warnings are missing scripts');
|
||||
});
|
||||
|
||||
test('random decks are legal', () => {
|
||||
const rng = makeRng(3);
|
||||
for (let i = 0; i < 50; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue