Replace thirdparty parse-ms with my own, and add tests
All checks were successful
CI / CI (push) Successful in 16s
All checks were successful
CI / CI (push) Successful in 16s
This commit is contained in:
parent
5081b9fec9
commit
906c0d86c0
5 changed files with 900071 additions and 11 deletions
900002
tests/expected/parse-ms-expected.json
Normal file
900002
tests/expected/parse-ms-expected.json
Normal file
File diff suppressed because it is too large
Load diff
12
tests/parse-ms.test.js
Normal file
12
tests/parse-ms.test.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
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])
|
||||
}
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue