Add tests
This commit is contained in:
parent
3bd6b0ac2c
commit
a64f40b6cc
11 changed files with 2252 additions and 21 deletions
13
src/Workers/worker.test.ts
Normal file
13
src/Workers/worker.test.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import BodyPartCosts from '../Constants/BodyPartCosts';
|
||||
import * as Workers from './index';
|
||||
|
||||
describe('Test Creep Workers', () => {
|
||||
console.log(Workers.Clerk)
|
||||
for (const [moduleName, worker] of Object.entries(Workers)) {
|
||||
test(`${moduleName}: Body parts cost calculation is correct`, () => {
|
||||
for (let cost = 0; cost < 1500; cost++) {
|
||||
expect(worker.bodyDefinition(cost).map((x) => BodyPartCosts[x]).reduce((x, y) => x + y, 0)).toBeLessThanOrEqual(cost);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue