mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-13 01:59:37 +00:00
Deps migration (#1988)
* chore: migrate eslint to oxlint * chore: migrate prettier to oxfmt * chore: migrate typescript * chore: toThrow should have a expected value * chore: cast test value as Day * chore: small title fix * chore: mocks should be hoisted * chore: incorrect async useage * chore: test should be inside description * chore: test sohuld include an expeced * chore: oxfmt --------- Co-authored-by: alex-Arc <omnivox@LAPTOP-RC5SNBVV.localdomain>
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import { Playback } from 'ontime-types';
|
||||
import type { Instant } from 'ontime-types';
|
||||
|
||||
import { isRestorePoint } from '../restore.parser.js';
|
||||
import { RestorePoint } from '../restore.type.js';
|
||||
|
||||
const asInstant = (value: number): Instant => value as Instant;
|
||||
|
||||
describe('isRestorePoint()', () => {
|
||||
it('validates a well defined object', () => {
|
||||
let restorePoint: RestorePoint = {
|
||||
@@ -12,7 +15,7 @@ describe('isRestorePoint()', () => {
|
||||
addedTime: 2,
|
||||
pausedAt: 3,
|
||||
firstStart: 1,
|
||||
startEpoch: 1,
|
||||
startEpoch: asInstant(1),
|
||||
currentDay: 0,
|
||||
};
|
||||
expect(isRestorePoint(restorePoint)).toBe(true);
|
||||
@@ -24,7 +27,7 @@ describe('isRestorePoint()', () => {
|
||||
addedTime: 0,
|
||||
pausedAt: null,
|
||||
firstStart: 1,
|
||||
startEpoch: 1,
|
||||
startEpoch: asInstant(1),
|
||||
currentDay: 2,
|
||||
};
|
||||
expect(isRestorePoint(restorePoint)).toBe(true);
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { Playback } from 'ontime-types';
|
||||
|
||||
import type { Instant } from 'ontime-types';
|
||||
import { vi } from 'vitest';
|
||||
|
||||
import { RestorePoint } from '../restore.type.js';
|
||||
import { restoreService } from '../restore.service.js';
|
||||
import { RestorePoint } from '../restore.type.js';
|
||||
|
||||
const asInstant = (value: number): Instant => value as Instant;
|
||||
|
||||
describe('restoreService', () => {
|
||||
describe('load()', () => {
|
||||
@@ -16,7 +18,7 @@ describe('restoreService', () => {
|
||||
addedTime: 5678,
|
||||
pausedAt: 9087,
|
||||
firstStart: 1234,
|
||||
startEpoch: 1234,
|
||||
startEpoch: asInstant(1234),
|
||||
currentDay: 0,
|
||||
};
|
||||
|
||||
@@ -35,7 +37,7 @@ describe('restoreService', () => {
|
||||
addedTime: 0,
|
||||
pausedAt: null,
|
||||
firstStart: 1234,
|
||||
startEpoch: 1234,
|
||||
startEpoch: asInstant(1234),
|
||||
currentDay: null,
|
||||
};
|
||||
|
||||
@@ -83,7 +85,7 @@ describe('restoreService', () => {
|
||||
addedTime: 1234,
|
||||
pausedAt: 1234,
|
||||
firstStart: 1234,
|
||||
startEpoch: 1234,
|
||||
startEpoch: asInstant(1234),
|
||||
currentDay: 0,
|
||||
};
|
||||
|
||||
@@ -101,7 +103,7 @@ describe('restoreService', () => {
|
||||
addedTime: 2345,
|
||||
pausedAt: 2345,
|
||||
firstStart: 2345,
|
||||
startEpoch: 2345,
|
||||
startEpoch: asInstant(2345),
|
||||
currentDay: 0,
|
||||
};
|
||||
|
||||
@@ -112,7 +114,7 @@ describe('restoreService', () => {
|
||||
addedTime: 3456,
|
||||
pausedAt: 3456,
|
||||
firstStart: 3456,
|
||||
startEpoch: 3456,
|
||||
startEpoch: asInstant(3456),
|
||||
currentDay: 1,
|
||||
};
|
||||
|
||||
@@ -134,7 +136,7 @@ describe('restoreService', () => {
|
||||
addedTime: 5678,
|
||||
pausedAt: 5678,
|
||||
firstStart: 5678,
|
||||
startEpoch: 5678,
|
||||
startEpoch: asInstant(5678),
|
||||
currentDay: 0,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user