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

Update Chai assertion library to the latest version #6690

Open
1 of 17 tasks
lindapaiste opened this issue Jan 2, 2024 · 6 comments
Open
1 of 17 tasks

Update Chai assertion library to the latest version #6690

lindapaiste opened this issue Jan 2, 2024 · 6 comments

Comments

@lindapaiste
Copy link
Contributor

Increasing Access

It would allow users to look at the Chai documentation and be able to use any assertions that they find there.

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build Process
  • Unit Testing
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

Feature enhancement details

We are using chai version ^3.5.0 but we should update it to ^5.0.0.

I tried writing a unit test with assert.notExists() but I got an error that notExists isn't a function. Updating to the latest version will enable more types of assertions like this.

@lindapaiste
Copy link
Contributor Author

On a related note, we say in the contributor docs

Similarly we can use assert.strictEqual(myp5.keyIsPressed, true) to assert if the value is true.

Personally I would use assert.isTrue(myp5.keyIsPressed) for that because I think it's better to use more specific assertions.

@ayushanand308
Copy link

ayushanand308 commented Jan 3, 2024

@lindapaiste I would like to have a go at it! Also, correct me if I am wrong but I think that latest release of chai is ^4.3.7

@limzykenneth
Copy link
Member

The latest release is 5.0.0. If there are no breaking change affecting our tests, this can go ahead and be updated.

@diyaayay
Copy link
Contributor

@ayushanand308 Are you working on this? I've too been looking to get some experience with unit tests, let me know if I can help or be a part of this issue in any way :)

@mohitbalwani
Copy link
Contributor

I tried running tests with latest Chai version and found that most of tests were failing. I am curious about how should we proceed next? I am assuming that it will require manual investigation on failing tests and fixing them?

@limzykenneth
Copy link
Member

If updating the version of Chai at this point is not very straightforward, I would suggest deferring it for now and focus on the 2.0 RFC at #6678 which proposes using Vitest to run the tests. Chai is bundled with Vitest (although we can use our own version if we really want to) so handling versions should not be an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants