UNPKG

slp-enforcer

Version:

Finds violations of the Melee Controller Ruleset by inspecting SLP files

24 lines (23 loc) 1.14 kB
"use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", { value: true }); const globals_1 = require("@jest/globals"); const index_1 = require("../index"); const fs = __importStar(require("fs")); const path = __importStar(require("path")); globals_1.test('Test control stick viz (Sanity check)', async () => { const slpDir = path.join(__dirname, '../../test_data/nonlegal/analog/goomwave_uptilt_p1.slp'); let data = fs.readFileSync(slpDir, null); let game = new index_1.SlippiGame(index_1.toArrayBuffer(data)); globals_1.expect(game).not.toBeNull(); let gameCoordsPortOne = index_1.getCoordListFromGame(game, 0, true); let checkResult = index_1.controlStickViz(game, 0, gameCoordsPortOne); globals_1.expect(checkResult.result).toEqual(false); globals_1.expect(checkResult.violations[0].evidence.length).toEqual(4845); });