Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #9 from georgiak/Unit-Code-Quality
Unit code quality
- Loading branch information
Showing
7 changed files
with
57 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -104,4 +104,9 @@ body { | ||
font-family: sans-serif; | ||
color: white; | ||
font-size: 20px; | ||
} | ||
|
||
|
||
.Error{ | ||
color:white; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'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() | ||
}) | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters