Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite the test runner to work with Jest 27 #68

Merged
merged 9 commits into from
Feb 6, 2022

Conversation

SleeplessByte
Copy link
Member

No description provided.

@SleeplessByte SleeplessByte added the x:size/massive Massive amount of work label Feb 6, 2022
@SleeplessByte SleeplessByte requested a review from a team as a code owner February 6, 2022 03:50
@SleeplessByte SleeplessByte changed the title Rewrite the test runner to work with Jest 17 Rewrite the test runner to work with Jest 27 Feb 6, 2022
@junedev
Copy link
Member

junedev commented Feb 6, 2022

This makes #30 obsolete/ resolves it, right?

Copy link
Member

@junedev junedev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some general comments, I don't think there is anyone who can do a proper review of the actual changes to the test runner you did as you are probably the only person that understands this piece currently.

Dockerfile Outdated Show resolved Hide resolved
@@ -1,7 +1,7 @@
// import spyConsole from './console'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file seems empty now (everything commented out), can it be deleted?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could, but we'll likely need it to process task IDs (which will come later) so I just left it.

src/output.ts Outdated Show resolved Hide resolved
src/reporter.ts Outdated Show resolved Hide resolved
@junedev
Copy link
Member

junedev commented Feb 6, 2022

@SleeplessByte I ran some tests and noticed the following.

With the main branch, an example for a failed test output looks like this:

    {
      "name": "Clock > Creating a new clock with an initial time > hour and minutes roll over continuously",
      "status": "fail",
      "message": "Error: expect(received).toEqual(expected) // deep equality\n\nExpected: \"11:01\"\nReceived: \"10:12\"",
      "output": null,
      "test_code": "expect(new Clock(201, 3001).toString()).toEqual('11:01');"
    },

With this new branch the output includes coloring (at least that is what I think it is):

    {
      "name": "Clock > Creating a new clock with an initial time > hour and minutes roll over continuously",
      "status": "fail",
      "message": "Error: \u001b[2mexpect(\u001b[22m\u001b[31mreceived\u001b[39m\u001b[2m).\u001b[22mtoEqual\u001b[2m(\u001b[22m\u001b[32mexpected\u001b[39m\u001b[2m) // deep equality\u001b[22m\n\nExpected: \u001b[32m\"1\u001b[7m1:01\u001b[27m\"\u001b[39m\nReceived: \u001b[31m\"1\u001b[7m0:12\u001b[27m\"\u001b[39m",
      "output": null,
      "test_code": "expect(new Clock(201, 3001).toString()).toEqual('11:01');"
    },

I am doubtful the website can handle the colors. If this is intended, are you sure about this? If this is not intended, I would have expected such a change should make some unit test fail.

@SleeplessByte
Copy link
Member Author

It can. And it's intended!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:size/massive Massive amount of work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants