Skip to content
Permalink
36c862a0f7
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
32 lines (27 sloc) 955 Bytes
'use strict'
const Uploads = require('../modules/upload.js')
describe('upload()', () => {
test('File Name missing', async done => {
expect.assertions(1)
const todo = await new Uploads()
await expect(todo.upload(
'png','',200,'Wed 20/20/19 15:20:20','path','Userpath')).rejects.toEqual(Error('String cannot be empty.'))
done()
})
test('File Not bigger than a GB', async done => {
expect.assertions(1)
const todo = await new Uploads()
await expect(todo.upload(
'png','name',1073741824,'Wed 20/20/19 15:20:20',
'path','Userpath')).rejects.toEqual(Error('Size cannot be equal or greater than a GB'))
done()
})
test('File Name string too long', async done => {
expect.assertions(1)
const todo = await new Uploads()
await expect(todo.upload(
'png','K8DbQxhva2qECr7urmCOVOayGnf6OUh2MCjYC9VaO04m9SXLui',
10750,'Wed 20/20/19 15:20:20','path','Userpath')).rejects.toEqual(Error('String size too big'))
done()
})
})