chore(duration): convert to chai/mocha syntahx

pull/6303/head
lutangar 2024-04-22 15:05:28 +02:00
parent d3b73e875a
commit b615bf1523
4 changed files with 24 additions and 18 deletions

View File

@ -19,3 +19,8 @@ const deepLearningFrameworks: DeepLearningFramework = [
}
]
```
What about the lifecycle of each transcriber ?
- install => installer
- update => udpater

View File

@ -1,22 +1,23 @@
import { toHumanReadable, toTimecode } from './duration';
import { expect } from 'chai'
import { toHumanReadable, toTimecode } from './duration.js'
describe('duration', () => {
test('toHumanReadable', async () => {
const ONE_MINUTE = 60000;
let humanDuration = toHumanReadable(ONE_MINUTE);
expect(humanDuration).toEqual('1m');
describe('duration conversion functions', () => {
it('toHumanReadable', () => {
const ONE_MINUTE = 60000
let humanDuration = toHumanReadable(ONE_MINUTE)
expect(humanDuration).to.equal('1m')
humanDuration = toHumanReadable(ONE_MINUTE * 60 + ONE_MINUTE);
expect(humanDuration).toEqual('1h 1m');
});
humanDuration = toHumanReadable(ONE_MINUTE * 60 + ONE_MINUTE)
expect(humanDuration).to.equal('1h 1m')
})
test('toTimecode', async () => {
const MORE_OR_LESS_ONE_MINUTE = '60.41545';
let timecode = toTimecode(MORE_OR_LESS_ONE_MINUTE);
expect(timecode).toEqual('00:01:00');
it('toTimecode', () => {
const MORE_OR_LESS_ONE_MINUTE = '60.41545'
let timecode = toTimecode(MORE_OR_LESS_ONE_MINUTE)
expect(timecode).to.equal('00:01:00')
const ONE_HOUR = '3600';
timecode = toTimecode(ONE_HOUR);
expect(timecode).toEqual('01:00:00');
});
});
const ONE_HOUR = '3600'
timecode = toTimecode(ONE_HOUR)
expect(timecode).to.equal('01:00:00')
})
})