Skip to content

Commit

Permalink
update tests to take parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
victhevenot committed Jan 14, 2016
1 parent 4074c67 commit 703ca7d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spec/array-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,36 @@ describe('#createArray', function(){

describe('#addElementToArray', function(){
it("should return an array of Christmas movies", function(){
expect(addElementToArray()).toEqual(['Home Alone', 'Love Actually', 'Elf', 'A Christmas Story'])
expect(addElementToArray(["Home Alone", "Love Actually", "Elf"])).toEqual(['Home Alone', 'Love Actually', 'Elf', 'A Christmas Story'])
});

});

describe('#accessElementFromArray', function(){
it("should returns the third item in the array", function(){
expect(accessElementFromArray()).toEqual("Virginia")
expect(accessElementFromArray(["New York", "California", "Virginia", "Louisiana", "Nevada"])).toEqual("Virginia")
});

});

describe('#replaceElementInArray', function(){
it("should replace the second item in array with 'Carter' and return that item", function(){
expect(replaceElementInArray()).toEqual("Carter")
expect(replaceElementInArray(["Joe", "Tim", "Stephen", "Sarah", "Stephanie"])).toEqual("Carter")
});

});

describe('#removeElementFromArray', function(){
it("should remove the third and fourth item from the array and add 'Roast Chicken'", function(){
expect(removeElementFromArray()).toEqual(["Pasta Alfredo", "Grilled Salmon", "Roast Chicken"])
expect(removeElementFromArray(["Pasta Alfredo", "Grilled Salmon", "Hamburgers", "Black Bean Soup"])).toEqual(["Pasta Alfredo", "Grilled Salmon", "Roast Chicken"])
});

});


describe('#iterateArray', function(){
it("should iterate over an original array to create a new array with updated elements from the original array'", function(){
expect(iterateArray()).toEqual([6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
expect(iterateArray([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])).toEqual([6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
});

});
Expand Down

0 comments on commit 703ca7d

Please sign in to comment.