Last active
January 7, 2020 04:03
-
-
Save Giagnus64/30d08c1abf75cbc15fb5770dbd688d28 to your computer and use it in GitHub Desktop.
Insertion Sort Initial Tests
This file contains hidden or 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
| const {insertionSort, swap} = require('./app'); | |
| //unit test | |
| test('Swaps two array entries', () => { | |
| expect(swap([1,2,3], 0, 1)).toStrictEqual([2,1,3]); | |
| }); | |
| //integration test | |
| test('Sorts array from lowest to highest - insertion sort', () => { | |
| expect (insertionSort([8,5,3,1,2,4])).toStrictEqual([1,2,3,4,5,8]); | |
| expect (insertionSort([1,2,4])).toStrictEqual([1,2,4]); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment