Add ESLint, Add worker utils
This commit is contained in:
parent
a64f40b6cc
commit
c026087af1
29 changed files with 3042 additions and 1734 deletions
|
|
@ -1,13 +1,16 @@
|
|||
import BodyPartCosts from '../Constants/BodyPartCosts';
|
||||
import * as Workers from './index';
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
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