mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-29 13:00:18 +00:00
And rewrite all the require calls. ```bash git mv src/utils/* packages/@uppy/utils/src sed -i 's/[./]*\/utils\//@uppy\/utils\/lib\//' src/**/*.js # transform (../)*utils → @uppy/utils ```
14 lines
413 B
JavaScript
14 lines
413 B
JavaScript
const getETA = require('./getETA')
|
|
|
|
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
|
|
}
|
|
expect(getETA(fileProgress)).toEqual(10.1)
|
|
})
|
|
})
|