discord_bot/tests/parse-ms.test.js
SileNce5k 906c0d86c0
All checks were successful
CI / CI (push) Successful in 16s
Replace thirdparty parse-ms with my own, and add tests
2024-10-28 01:44:53 +01:00

12 lines
No EOL
397 B
JavaScript

const parseMS = require('../util/parseMS')
const fs = require('fs')
const file = 'tests/expected/parse-ms-expected.json';
const expectedOutput = JSON.parse(fs.readFileSync(file, {encoding: "utf-8"}));
test("Testing my parseMS", () => {
for(let i = 0; i < expectedOutput.length; i++){
const ms = i * i * 2;
expect(parseMS(ms)).toStrictEqual(expectedOutput[i])
}
})