uppy/packages/@uppy/utils/src/getETA.test.ts
Prakash d301c01d6a
@uppy/utils: update export maps (#5900)
- 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>
2025-08-19 12:25:27 +02:00

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)
})
})