Last active
August 25, 2016 03:34
-
-
Save piq9117/bba29c20fd780c49ffc9e232136186b0 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
You can use any testing suite and assertion library you want. | |
I test with mocha & chai | |
*/ | |
const person = { | |
name: 'ken', | |
favoriteFood: [] | |
} | |
function favoriteFood (food) { | |
person.favoriteFood.push(food) | |
} | |
favoriteFood('apple') | |
favoriteFood('ramen') | |
describe('personObject', () => { | |
it('it will add food to favoriteFood list', () => { | |
expect(person).to.equal({ | |
name: 'ken', | |
favoriteFood: ['apple', 'ramen'] | |
}) | |
}) | |
}) | |
// This will pass! :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment