Created
December 30, 2015 13:10
-
-
Save qetr1ck-op/0cc977fb500184b5c15e to your computer and use it in GitHub Desktop.
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 testAddCounter = () => { | |
const listBefore = []; | |
const listAfter = [0]; | |
deepFreeze(listBefore); | |
expect( | |
addCounter(listBefore) | |
).toEqual(listAfter); | |
}; | |
const testRemoveCounter = () => { | |
const listBefore = [0, 10, 20]; | |
const listAfter = [0, 20]; | |
deepFreeze(listBefore); | |
expect ( | |
removeCounter(listBefore, 1) | |
).toEqual(listAfter); | |
}; | |
const testIncrementCounter = () => { | |
const listBefore = [0, 10, 20]; | |
const listAfter = [0, 11, 20]; | |
deepFreeze(listBefore); | |
expect( | |
incrementCounter(listBefore, 1) | |
).toEqual(listAfter); | |
}; | |
testAddCounter(); | |
testRemoveCounter(); | |
testIncrementCounter(); | |
console.log('All tests passed') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment