Test cleanup and fixes [i-l]

This commit is contained in:
Angelos Chalaris
2018-06-18 17:31:56 +03:00
parent f67e121ed8
commit 82f0d6bc52
59 changed files with 358 additions and 452 deletions

View File

@ -1,42 +1,39 @@
const expect = require('expect');
const isSorted = require('./isSorted.js');
test('isSorted is a Function', () => {
test('isSorted is a Function', () => {
expect(isSorted).toBeInstanceOf(Function);
});
test('Array is sorted in ascending order', () => {
expect(isSorted([0, 1, 2]), 1).toBe()
test('Array is sorted in ascending order', () => {
expect(isSorted([0, 1, 2])).toBe(1);
});
test('Array is sorted in ascending order', () => {
expect(isSorted([0, 1, 2, 2]), 1).toBe()
test('Array is sorted in ascending order', () => {
expect(isSorted([0, 1, 2, 2])).toBe(1);
});
test('Array is sorted in ascending order', () => {
expect(isSorted([-4, -3, -2]), 1).toBe()
test('Array is sorted in ascending order', () => {
expect(isSorted([-4, -3, -2])).toBe(1);
});
test('Array is sorted in ascending order', () => {
expect(isSorted([0, 0, 1, 2]), 1).toBe()
test('Array is sorted in ascending order', () => {
expect(isSorted([0, 0, 1, 2])).toBe(1);
});
test('Array is sorted in descending order', () => {
expect(isSorted([2, 1, 0]), -1).toBe()
test('Array is sorted in descending order', () => {
expect(isSorted([2, 1, 0])).toBe(-1);
});
test('Array is sorted in descending order', () => {
expect(isSorted([2, 2, 1, 0]), -1).toBe()
test('Array is sorted in descending order', () => {
expect(isSorted([2, 2, 1, 0])).toBe(-1);
});
test('Array is sorted in descending order', () => {
expect(isSorted([-2, -3, -4]), -1).toBe()
test('Array is sorted in descending order', () => {
expect(isSorted([-2, -3, -4])).toBe(-1);
});
test('Array is sorted in descending order', () => {
expect(isSorted([2, 1, 0, 0]), -1).toBe()
test('Array is sorted in descending order', () => {
expect(isSorted([2, 1, 0, 0])).toBe(-1);
});
test('Array is empty', () => {
expect(isSorted([]), undefined).toBe()
test('Array is empty', () => {
expect(isSorted([])).toBe(undefined);
});
test('Array is not sorted, direction changed in array', () => {
expect(isSorted([1]), 0).toBe()
test('Array is not sorted, direction changed in array', () => {
expect(isSorted([1])).toBe(0);
});
test('Array is not sorted, direction changed in array', () => {
expect(isSorted([1, 2, 1]), 0).toBe()
test('Array is not sorted, direction changed in array', () => {
expect(isSorted([1, 2, 1])).toBe(0);
});