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

in step 5, an unrelated test still fails after applying the suggested fix #55

Closed jhampson-dbre closed 3 years ago

jhampson-dbre commented 3 years ago

Bug Report

Current behavior In step 5 Fix the test, the tests still fail after applying the fix, due to another test failure

 App › Contains the compiled JavaScript

    Test functions cannot both take a 'done' callback and return something. Either use a 'done' callback, or return a promise.
    Returned value: Promise {}

      3 |
      4 | describe('App', () => {
    > 5 |   it('Contains the compiled JavaScript', async (done) => {
        |   ^
      6 |     fs.readFile('./public/main.js', 'utf8', (err, data) => {
      7 |       expect(err).toBe(null)
      8 |       expect(data).toMatchSnapshot()

      at Object.<anonymous>.describe (__test__/game.test.js:5:3)
      at Object.<anonymous> (__test__/game.test.js:4:1)

Reproduction Steps to reproduce the behavior in the course:

  1. Go to 'GitHub Actions: Continuous Integration'
  2. In Step 5, commit the suggested fix for the expected failing test
  3. GitHub Learning Lab Bot will reply on the pull request 'The Actions workflow failed and I was expecting it to succeed. Let's see if we can find how to fix it.'
  4. See error in the Actions log

Expected behavior After committing the suggested fix in step 5, all tests should pass.

Possible solution I don't have much Node experience, but the failing test explains 'Test functions cannot both take a 'done' callback and return something. Either use a 'done' callback, or return a promise.'

Additional context My learning lab repo where I'm experience the error. https://github.com/jhampson-dbre/github-actions-for-ci/pull/2

There is also a report of the same error in the forums: https://github.community/t/github-actions-for-ci-stuck-on-step-5/182063

yzAlvin commented 3 years ago

I had the same problem. I got around it by commenting/deleting that specific test in game.test.js as well as deleting the game.test.js.snap file

dzeyelid commented 3 years ago

I got the same problem.

I found the solution, so created a pull request githubtraining/using-github-actions-for-ci-template#15.

With the fix, my workflow of this course could pass the test.

KietNhiTran commented 3 years ago

Same issue here.

brianamarie commented 3 years ago

Thank you @dzeyelid for the pull request! ✨ I have merged the pull request. If anyone could confirm here that they are seeing different results than before, that would be greatly appreciated.

In the meantime, I'll keep an eye out for any other unexpected errors or bugs. Thanks all for contributing!