Open lindapaiste opened 10 months ago
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.
@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
The latest release is 5.0.0. If there are no breaking change affecting our tests, this can go ahead and be updated.
@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 :)
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?
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.
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?
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 thatnotExists
isn't a function. Updating to the latest version will enable more types of assertions like this.