test(timeutils): adds testing for timeUtils mixin

This commit is contained in:
Cameron 2020-10-02 22:41:46 +01:00
parent 0a5cd7922c
commit bac67c1245

View File

@ -0,0 +1,16 @@
import Vue from 'vue';
import timeUtils from '~/mixins/timeUtils.ts';
const TestComponent = new Vue({
mixins: [timeUtils]
});
describe('timeUtils', () => {
test('converts time from ms to ticks', () => {
expect(TestComponent.ticksToMs(10000)).toEqual(1);
});
test('converts time from ticks to ms', () => {
expect(TestComponent.msToTicks(1)).toEqual(10000);
});
});