slp-enforcer
Version:
Finds violations of the Melee Controller Ruleset by inspecting SLP files
35 lines (34 loc) • 1.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const types_1 = require("../types");
const gameTimer_1 = require("./gameTimer");
describe("when calculating the in-game timer", () => {
it("should return unknown if no starting timer is provided", () => {
const gameTimer = gameTimer_1.frameToGameTimer(1234, {
timerType: types_1.TimerType.DECREASING,
startingTimerSeconds: null,
});
expect(gameTimer).toEqual("Unknown");
});
it("should support increasing timers", () => {
const gameTimer = gameTimer_1.frameToGameTimer(2014, {
timerType: types_1.TimerType.INCREASING,
startingTimerSeconds: 0,
});
expect(gameTimer).toEqual("00:33.57");
});
it("should support decreasing timers", () => {
const gameTimer = gameTimer_1.frameToGameTimer(4095, {
timerType: types_1.TimerType.DECREASING,
startingTimerSeconds: 180,
});
expect(gameTimer).toEqual("01:51.76");
});
it("should support when the exact limit is hit", () => {
const gameTimer = gameTimer_1.frameToGameTimer(10800, {
timerType: types_1.TimerType.DECREASING,
startingTimerSeconds: 180,
});
expect(gameTimer).toEqual("00:00.00");
});
});