Open github-learning-lab[bot] opened 2 years ago
Yepp, add commit to trigger CI
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.
Welcome
In this repository, we'll be diving into the world of Continuous Integration. Continuous Integration, or CI, can benefit your projects and change how you work on GitHub. If you're new to Continuous Integration, you may be thinking, "What exactly is it, and do I need it in my project?"
What is CI? Why should you care?
CI can help you stick to your team’s quality standards by running tests and reporting the results on GitHub. CI tools run builds and tests, triggered by commits. The results post back to GitHub in the pull request. This reduces context switching for developers, and improves consistency for testing. The goal is fewer bugs in production and faster feedback while developing.
Choices around CI that will work best for your project depend on many factors, including:
Using CI and Learning Lab
In other courses, you may have noticed that some actions take me longer to respond to than others. In this course, many of the actions will be related to builds. Those builds sometimes take longer to build, up to several minutes. Don't be concerned if I take a few minutes to respond, or if I respond too quickly. Sometimes, I'll let you know what the build will say before it finishes! Please wait for the builds to finish before moving on to your next step.
If you aren't already familiar, it may be a good idea to go through the Introduction to GitHub Learning Lab.
Step 1: Use a templated workflow
There's a bug somewhere in this repository. We'll use the practice of Continuous Integration (CI) to set up some automated testing to make it easier to discover, diagnose, and minimize scenarios like this.
Let's first introduce CI to this repository. The codebase is written with Node.js. GitHub Actions allows us to use some templated workflows for common languages and frameworks, like Node.js! Let's add it:
:keyboard: Activity: Create a pull request with a templated workflow
I'll respond in the new pull request when I detect it has been created.
If at any point you're expecting a response and don't see one, refresh the page.