Test cleanup and fixes [a-b]

This commit is contained in:
Angelos Chalaris
2018-06-18 15:54:48 +03:00
parent a78f5db260
commit 026c65a5e6
151 changed files with 753 additions and 373 deletions

View File

@ -5,8 +5,12 @@ const quickSort = require('./quickSort.js');
test('quickSort is a Function', () => {
expect(quickSort).toBeInstanceOf(Function);
});
t.deepEqual(quickSort([5, 6, 4, 3, 1, 2]), [1, 2, 3, 4, 5, 6], 'quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6]');
t.deepEqual(quickSort([-1, 0, -2]), [-2, -1, 0], 'quickSort([-1, 0, -2]) returns [-2, -1, 0]');
test('quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6]', () => {
expect(quickSort([5, 6, 4, 3, 1, 2]), [1, 2, 3, 4, 5, 6]).toEqual()
});
test('quickSort([-1, 0, -2]) returns [-2, -1, 0]', () => {
expect(quickSort([-1, 0, -2]), [-2, -1, 0]).toEqual()
});
t.throws(() => quickSort(), 'quickSort() throws an error');
t.throws(() => quickSort(123), 'quickSort(123) throws an error');
t.throws(() => quickSort({ 234: string}), 'quickSort({ 234: string}) throws an error');