mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-29 23:03:04 +00:00
Add test
This commit is contained in:
parent
1947835c51
commit
8946f3ea18
1 changed files with 29 additions and 0 deletions
|
@ -309,6 +309,35 @@ describe('Chart', () => {
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it('Can specify offset (floor time)', async(async () => {
|
||||||
|
clock.tick('00:30:00');
|
||||||
|
|
||||||
|
await testChart.increment();
|
||||||
|
|
||||||
|
clock.tick('01:30:00');
|
||||||
|
|
||||||
|
await testChart.increment();
|
||||||
|
|
||||||
|
const chartHours = await testChart.getChart('hour', 3, 1);
|
||||||
|
const chartDays = await testChart.getChart('day', 3, 1);
|
||||||
|
|
||||||
|
assert.deepStrictEqual(chartHours, {
|
||||||
|
foo: {
|
||||||
|
dec: [0, 0, 0],
|
||||||
|
inc: [1, 0, 0],
|
||||||
|
total: [1, 0, 0]
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.deepStrictEqual(chartDays, {
|
||||||
|
foo: {
|
||||||
|
dec: [0, 0, 0],
|
||||||
|
inc: [0, 0, 0],
|
||||||
|
total: [0, 0, 0]
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
describe('Grouped', () => {
|
describe('Grouped', () => {
|
||||||
it('Can updates', async(async () => {
|
it('Can updates', async(async () => {
|
||||||
await testGroupedChart.increment('alice');
|
await testGroupedChart.increment('alice');
|
||||||
|
|
Loading…
Reference in a new issue