Open MahmoudMabrok opened 4 years ago
That wasn't the test name I expected, but that's alright. If you typed something slightly different than what I looked for that may explain it.
I expected one of the following test names:
Let's keep going anyway!
One of the failing tests is: Initializes with two players
. If you dig deeper into the logs, you may notice these results in particular:
● Game › Game › Initializes with two players
expect(received).toBe(expected) // Object.is equality
Expected: "Nate"
Received: "Bananas"
12 | it('Initializes with two players', async () => {
13 | expect(game.p1).toBe('Salem')
> 14 | expect(game.p2).toBe('Nate')
| ^
15 | })
16 |
17 | it('Initializes with an empty board', async () => {
at Object.toBe (__test__/game.test.js:14:23)
This tells us that a unit test has been written that names the two players Salem and Nate, and then checks if that name sticks. However, we get :banana: Bananas instead of Nate! How did this happen?
To find out, it may help to know it's common practice to name test files the same as the code file they are testing, but with a .test.js
extension. Therefore, we can assume that the test result from game.test.js
is caused by a problem in game.js
. I'll point it out below.
Make the changes suggested below. I'll respond when the workflow runs.
@MahmoudMabrok the source code is for the tic tac toe game, but the purpose of the repo is to practice the CI in github actions