Test cleanup and fixes [c-d]

This commit is contained in:
Angelos Chalaris
2018-06-18 16:34:04 +03:00
parent 026c65a5e6
commit eb3cb2f928
136 changed files with 805 additions and 484 deletions

View File

@ -5,7 +5,13 @@ const prettyBytes = require('./prettyBytes.js');
test('prettyBytes is a Function', () => {
expect(prettyBytes).toBeInstanceOf(Function);
});
t.equal(prettyBytes(1000), '1 KB', "Converts a number in bytes to a human-readable string.");
t.equal(prettyBytes(-27145424323.5821, 5), '-27.145 GB', "Converts a number in bytes to a human-readable string.");
t.equal(prettyBytes(123456789, 3, false), '123MB', "Converts a number in bytes to a human-readable string.");
test('Converts a number in bytes to a human-readable string.', () => {
expect(prettyBytes(1000)).toBe('1 KB')
});
test('Converts a number in bytes to a human-readable string.', () => {
expect(prettyBytes(-27145424323.5821, 5)).toBe('-27.145 GB')
});
test('Converts a number in bytes to a human-readable string.', () => {
expect(prettyBytes(123456789, 3, false)).toBe('123MB')
});