import Chart, { KVs } from '../core.js'; import { name, schema } from './entities/test.js'; /** * For testing */ // eslint-disable-next-line import/no-default-export export default class TestChart extends Chart { public total = 0; // publicにするのはテストのため constructor() { super(name, schema); } protected async tickMajor(): Promise>> { return { 'foo.total': this.total, }; } protected async tickMinor(): Promise>> { return {}; } public async increment(): Promise { this.total++; await this.commit({ 'foo.total': 1, 'foo.inc': 1, }); } public async decrement(): Promise { this.total--; await this.commit({ 'foo.total': -1, 'foo.dec': 1, }); } }