class Round {
constructor(deck) {
this.deck = deck.cards;
this.counter = 0;
this.turn = turn;
this.incorrectGuess = [];
this.correctGuess = [];
}
}
You did have this.turn = turn
commented out, so I'm not sure if this was something you were trying to use. If so, we aren't passing in a "turn" to the constructor, like we are with deck so it is undefined. I don't think you need this.turn
at all, since you are keeping track of the number of turns with your counter.
it('should store correct guesses', function() {
// const turn1 = new Turn('spleen', card2)
// const turn2 = new Turn('appendix', card2);
// const turn = new Turn('gallbladder', card2);
const round = new Round(deck1);
// round.takeTurn(turn1);
// expect(round.correctGuess).to.deep.equal([]);
// round.takeTurn('appendix');
// expect(round.correctGuess).to.deep.equal([]);
round.takeTurn('gallbladder');
expect(round.correctGuess).to.deep.equal(['gallbladder']);
});
For your failing test - take a look at what the correct answer is for deck1, card1 - make sure you're passing in the correctGuess.