Skip to content

Have the repository use Mocha and Chai to test stuff#190

Merged
geoffrey-wu merged 28 commits into
qbreader:mainfrom
Captain-Quack:Mocha-+-Chai
Jul 1, 2023
Merged

Have the repository use Mocha and Chai to test stuff#190
geoffrey-wu merged 28 commits into
qbreader:mainfrom
Captain-Quack:Mocha-+-Chai

Conversation

@Captain-Quack
Copy link
Copy Markdown
Contributor

@Captain-Quack Captain-Quack commented Jun 27, 2023

This is my first time contributing big changes like this, and it was compiled to Git Hub from a messy draft that was worked on for a while. Everything should work correctly (according to ESLint), but I still think this could use some extra eyes, especially with the package.json file.


As qbreader gets more and more stuff added, making sure everything functions right becomes more and more important. That's why I propose implementing the tests with a library and framework specifically built for doing just that.

It should be easier and quicker to add new tests now, and save everyone from all of the boring labor of having to set these up manually :)

A few things to know:

  • In all of the examples, you don't have to require mocha. Coming from Python and C#, that doesn't seem right, but maybe JS has some global import feature?
  • in package.json, you'll see I added npm test to the "build" string. That way, the testing will (supposedly) automatically be run with each build.
  • Some sources said that the describe function is asynchronous, but none of the documentation used await with it. There might be some wacky thing that happens to the successful and total variables in the server tests. If said wacky thing does happen, that's why.

@Captain-Quack Captain-Quack marked this pull request as ready for review June 27, 2023 03:17
@Captain-Quack Captain-Quack changed the title [Extra Reviewing Needed] Have the repository use Mocha and Chai to test stuff Have the repository use Mocha and Chai to test stuff Jun 27, 2023
@geoffrey-wu geoffrey-wu merged commit c5bffc4 into qbreader:main Jul 1, 2023
@Captain-Quack Captain-Quack deleted the Mocha-+-Chai branch July 1, 2023 18:41
@Captain-Quack
Copy link
Copy Markdown
Contributor Author

@geoffrey-wu thank you for fixing all of that 👍

geoffrey-wu added a commit that referenced this pull request Jul 31, 2025
Have the repository use Mocha and Chai to test stuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants