Update prettier and reformat code

This commit is contained in:
2020-10-10 10:21:30 +03:00
parent ecaa98b69c
commit 60078e94b2
39 changed files with 149 additions and 146 deletions

View File

@ -4,23 +4,23 @@ import { expect } from 'chai';
import { Resources } from '../../src/Core/Resources';
import { calcGatheringTimings, GatheringTimings } from '../../src/Core/GatheringTimings';
describe('Gathering timings', function() {
it('Can calc common from numbers', function() {
describe('Gathering timings', function () {
it('Can calc common from numbers', function () {
const timings = GatheringTimings.create(10, 20, 15, 5);
expect(20).to.equals(timings.slowest.seconds);
});
it('Can calc common with never', function() {
it('Can calc common with never', function () {
const timings = GatheringTimings.create(10, 20, 'never', 5);
expect(true).to.equals(timings.slowest.never);
});
it('Can calc common with all never', function() {
it('Can calc common with all never', function () {
const timings = GatheringTimings.create('never', 'never', 'never', 'never');
expect(true).to.equals(timings.slowest.never);
});
it('Can calc timings', function() {
it('Can calc timings', function () {
const resources = new Resources(10, 10, 10, 10);
const desired = new Resources(60, 60, 60, 60);
const speed = new Resources(5, 5, 5, 5);
@ -28,7 +28,7 @@ describe('Gathering timings', function() {
expect(10 * 3600).to.equals(timings.slowest.seconds);
});
it('Can calc timings with different speed', function() {
it('Can calc timings with different speed', function () {
const resources = new Resources(10, 10, 10, 10);
const desired = new Resources(60, 60, 60, 60);
const speed = new Resources(5, 10, 25, 5);
@ -40,7 +40,7 @@ describe('Gathering timings', function() {
expect(10 * 3600).to.equals(timings.slowest.seconds);
});
it('Can calc timings with negative speed', function() {
it('Can calc timings with negative speed', function () {
const resources = new Resources(10, 10, 10, 10);
const desired = new Resources(60, 60, 60, 60);
const speed = new Resources(5, 10, 25, -5);

View File

@ -5,14 +5,14 @@ import { calcHeroResource } from '../../src/Core/HeroBalance';
import { Resources } from '../../src/Core/Resources';
import { ResourceType } from '../../src/Core/ResourceType';
describe('HeroBalance', function() {
it('Get resource for single requirement', function() {
describe('HeroBalance', function () {
it('Get resource for single requirement', function () {
const req = new Resources(0, 0, -100, 0);
const heroRes = calcHeroResource([req]);
expect(heroRes).to.equals(ResourceType.Iron);
});
it('Get resource for second requirement', function() {
it('Get resource for second requirement', function () {
const req1 = new Resources(0, 0, 100, 0);
const req2 = new Resources(0, -200, 20, 0);
const heroRes = calcHeroResource([req1, req2]);

View File

@ -3,45 +3,45 @@ import { expect } from 'chai';
import { Resources } from '../../src/Core/Resources';
describe('Resources', function() {
it('Can compare with lt', function() {
describe('Resources', function () {
it('Can compare with lt', function () {
const x = new Resources(0, 0, 0, 0);
const y = new Resources(5, 5, 5, 5);
expect(x.anyLower(y)).is.true;
});
it('Can compare with lt (mixed)', function() {
it('Can compare with lt (mixed)', function () {
const x = new Resources(20, 20, 5, 20);
const y = new Resources(10, 10, 10, 10);
expect(x.anyLower(y)).is.true;
});
it('Can compare with gt', function() {
it('Can compare with gt', function () {
const x = new Resources(5, 5, 5, 5);
const y = new Resources(0, 0, 0, 0);
expect(x.allGreater(y)).is.true;
});
it('Can compare with gt (mixed)', function() {
it('Can compare with gt (mixed)', function () {
const x = new Resources(30, 30, 10, 30);
const y = new Resources(20, 20, 20, 20);
expect(x.allGreater(y)).is.false;
});
it('Can up to 1', function() {
it('Can up to 1', function () {
const resources = new Resources(0, 4, 10, 18);
const upped = resources.upTo(1);
expect(upped.eq(resources)).is.true;
});
it('Can up to 10', function() {
it('Can up to 10', function () {
const resources = new Resources(0, 4, 10, 18);
const expected = new Resources(0, 10, 10, 20);
const upped = resources.upTo(10);
expect(upped.eq(expected)).is.true;
});
it('Can down to 10', function() {
it('Can down to 10', function () {
const resources = new Resources(0, 4, 10, 18);
const expected = new Resources(0, 0, 10, 10);
const lowed = resources.downTo(10);