Created
May 27, 2020 03:31
-
-
Save kozo002/99beb2569359326f66a69327e141f8cc to your computer and use it in GitHub Desktop.
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
function validateImageSize(file: File): boolean { | |
return file.size < 10000 | |
} | |
describe('when the file size is exceeded the limitation', () => { | |
it('returns false', () => { | |
const dummyFile = new File([''], 'example.jpg') | |
dummyFile.size = 10001 | |
expect(validateImageSize(dummyFile)).toBe(false) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment