feat: better code formatting
This commit is contained in:
@@ -1,37 +1,37 @@
|
||||
import {assert} from "chai";
|
||||
import {loop} from "../../src/main";
|
||||
import {Game, Memory} from "./mock"
|
||||
import { loop } from '../../src/main';
|
||||
import { Game, Memory } from './mock';
|
||||
import { assert } from 'chai';
|
||||
|
||||
describe("main", () => {
|
||||
before(() => {
|
||||
// runs before all test in this block
|
||||
});
|
||||
describe('main', () => {
|
||||
before(() => {
|
||||
// runs before all test in this block
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
// runs before each test in this block
|
||||
// @ts-ignore : allow adding Game to global
|
||||
global.Game = _.clone(Game);
|
||||
// @ts-ignore : allow adding Memory to global
|
||||
global.Memory = _.clone(Memory);
|
||||
});
|
||||
beforeEach(() => {
|
||||
// runs before each test in this block
|
||||
// @ts-ignore : allow adding Game to global
|
||||
global.Game = _.clone(Game);
|
||||
// @ts-ignore : allow adding Memory to global
|
||||
global.Memory = _.clone(Memory);
|
||||
});
|
||||
|
||||
it("should export a loop function", () => {
|
||||
assert.isTrue(typeof loop === "function");
|
||||
});
|
||||
it('should export a loop function', () => {
|
||||
assert.isTrue(typeof loop === 'function');
|
||||
});
|
||||
|
||||
it("should return void when called with no context", () => {
|
||||
assert.isUndefined(loop());
|
||||
});
|
||||
it('should return void when called with no context', () => {
|
||||
assert.isUndefined(loop());
|
||||
});
|
||||
|
||||
it("Automatically delete memory of missing creeps", () => {
|
||||
Memory.creeps.persistValue = "any value";
|
||||
Memory.creeps.notPersistValue = "any value";
|
||||
it('Automatically delete memory of missing creeps', () => {
|
||||
Memory.creeps.persistValue = 'any value';
|
||||
Memory.creeps.notPersistValue = 'any value';
|
||||
|
||||
Game.creeps.persistValue = "any value";
|
||||
Game.creeps.persistValue = 'any value';
|
||||
|
||||
loop();
|
||||
loop();
|
||||
|
||||
assert.isDefined(Memory.creeps.persistValue);
|
||||
assert.isUndefined(Memory.creeps.notPersistValue);
|
||||
});
|
||||
assert.isDefined(Memory.creeps.persistValue);
|
||||
assert.isUndefined(Memory.creeps.notPersistValue);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user