-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.js
More file actions
19 lines (16 loc) · 749 Bytes
/
tests.js
File metadata and controls
19 lines (16 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const assert = require('assert');
describe('timeValueInMill', () => {
it('should return the correct time value in milliseconds', () => {
assert.strictEqual(timeValueInMill('12:30'), 45000000);
assert.strictEqual(timeValueInMill('01:15'), 4500000);
assert.strictEqual(timeValueInMill('06:45'), 24300000);
});
it('should handle leading zeros in the time input', () => {
assert.strictEqual(timeValueInMill('08:05'), 29100000);
assert.strictEqual(timeValueInMill('09:00'), 32400000);
});
it('should handle time inputs with single digit hours and minutes', () => {
assert.strictEqual(timeValueInMill('1:30'), 5400000);
assert.strictEqual(timeValueInMill('9:5'), 32700000);
});
});