githubtraining / using-github-actions-for-ci

Course repository for "GitHub Actions: Continuous Integration"
https://lab.github.com/githubtraining/github-actions:-continuous-integration
Creative Commons Attribution 4.0 International
3 stars 16 forks source link

Step 3 Missing 'Contains the compiled JavaScript' test in list of failing tests #59

Closed achekery closed 2 years ago

achekery commented 2 years ago

Bug Report

Current behavior

When user comments 'Contains the compiled JavaScript' in response to '⌨️ Activity: Tell the bot which test is failing so we can fix it', github-learning-lab bot doesn't recognize it as one of the expected failing tests. However, this is indeed one of the failing tests.

https://github.com/achekerylla/github-actions-for-ci/pull/2

Screenshot (7)_LI

https://github.com/achekerylla/github-actions-for-ci/pull/2/checks?check_run_id=3779688078

Screenshot (8)_LI

Reproduction Steps to reproduce the behavior in the course:

  1. Go to my user comment 'Contains the compiled JavaScript' at https://github.com/achekerylla/github-actions-for-ci/pull/2#issuecomment-932851874
  2. Scroll down to the next comment from github-learning-lab bot '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.'
  3. See error in that comment

Expected behavior Expected github-learning-lab bot to recognize 'Contains the compiled JavaScript' as one of the expected failing tests.

Possible solution PR Add contains test to list of failing tests #60

Additional context In test output for 'Contains the compiled JavaScript', the failure is here

       5 |   it('Contains the compiled JavaScript', async () => {
       6 |     const data = fs.readFileSync('./public/main.js', 'utf8')
    >  7 |     expect(data).toMatchSnapshot()
         |                  ^
       8 |   })
       9 | })
      10 |

      at Object.<anonymous> (__test__/game.test.js:7:18)

When we compare snapshot/received using js test output rewrapped to multi-line format and git diff --no-index, we see the difference is in the class r constructor.

$ git diff --no-index ./snapshot.js ./received.js
diff --git a/./snapshot.js b/./received.js
index 2cff790..5b01bee 100644
--- a/./snapshot.js
+++ b/./received.js
@@ -50,7 +50,7 @@
   }));
   class r {
     constructor(t, e) {
-      this.p1 = t, this.p2 = e, this.board = [
+      this.p1 = t, this.p2 = "Bananas", this.board = [
         [null, null, null],
         [null, null, null],
         [null, null, null]
achekery commented 2 years ago

PR merged. Closing this issue.