mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 11:14:05 +00:00
- cleanup `@uppy/utils ` removed unused / redundant modules . - migrated modules and tests from `.js` to `.ts` - removed all the nested export paths - updated `@uppy/utils` import paths for all packages - `@uppy/angular` is still failing while running`yarn build` , I'm looking into it. --------- Co-authored-by: Merlijn Vos <merlijn@soverin.net>
15 lines
468 B
TypeScript
15 lines
468 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import getETA from './getETA.js'
|
|
|
|
describe('getETA', () => {
|
|
it('should get the ETA remaining based on a fileProgress object', () => {
|
|
const dateNow = new Date()
|
|
const date5SecondsAgo = new Date(dateNow.getTime() - 5 * 1000)
|
|
const fileProgress = {
|
|
bytesUploaded: 1024,
|
|
bytesTotal: 3096,
|
|
uploadStarted: date5SecondsAgo.getTime(),
|
|
}
|
|
expect(getETA(fileProgress)).toEqual(10.1)
|
|
})
|
|
})
|