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

@ -15,15 +15,15 @@ class MemoryStatisticsStorage implements StatisticsStorageInterface {
}
}
describe('Statistics', function() {
it('Can save statistics item', function() {
describe('Statistics', function () {
it('Can save statistics item', function () {
const storage = new MemoryStatisticsStorage();
const statistics = new Statistics(storage);
statistics.incrementAction(1588408294);
expect(Object.keys(statistics.getActionStatistics())).to.has.lengthOf(1);
});
it('Can trim statistics', function() {
it('Can trim statistics', function () {
const storage = new MemoryStatisticsStorage();
const statistics = new Statistics(storage);
const baseTime = 1588408294;

View File

@ -6,34 +6,34 @@ import { NullLogger } from '../../src/Logger';
import { ArrayTaskProvider } from '../../src/Queue/TaskProvider/ArrayTaskProvider';
import { Task } from '../../src/Queue/Task';
describe('Task Queue', function() {
it('Can get task from queue', function() {
describe('Task Queue', function () {
it('Can get task from queue', function () {
const provider = new ArrayTaskProvider([new Task('1', 0, 'task', {})]);
const queue = new TaskQueue(provider, new NullLogger());
const task = queue.get(1);
expect(task).to.be.instanceOf(Task);
});
it("Don't get unready task from queue", function() {
it("Don't get unready task from queue", function () {
const provider = new ArrayTaskProvider([new Task('1', 5, 'task', {})]);
const queue = new TaskQueue(provider, new NullLogger());
const task = queue.get(1);
expect(task).to.be.undefined;
});
it('Can remove task by id', function() {
it('Can remove task by id', function () {
const provider = new ArrayTaskProvider([
new Task('id1', 1, 'task1', {}),
new Task('id2', 2, 'task2', {}),
]);
const queue = new TaskQueue(provider, new NullLogger());
queue.remove(t => t.id === 'id1');
queue.remove((t) => t.id === 'id1');
const tasks = provider.getTasks();
expect(tasks).to.have.lengthOf(1);
expect(tasks[0].ts).to.be.equals(2);
});
it('Can modify tasks', function() {
it('Can modify tasks', function () {
const provider = new ArrayTaskProvider([
new Task('1', 1, 'task1', {}),
new Task('2', 3, 'task2', {}),
@ -41,8 +41,8 @@ describe('Task Queue', function() {
]);
const queue = new TaskQueue(provider, new NullLogger());
queue.modify(
t => t.ts < 4,
t => new Task(t.id, 10, t.name, t.args)
(t) => t.ts < 4,
(t) => new Task(t.id, 10, t.name, t.args)
);
const tasks = provider.getTasks();
expect(4).is.equals(tasks[0].ts);