clone this repository somewhere on your local environment with git clone https://github.com/doppelganger9/babyfoot.git
(or the SSH URL if you prefer)
install all dependencies with npm install
you can check the unit tests with npm test
then you can run the server API with npm start
, just keep the process running and in another shell:
npm newman
which will use PostMan on the CLInpm start
process to stop the local development server.npm test
Unit Testing was done by leveraging Chai, Mocha and TypeScript.
It definitely helped me:
Code coverage is nice, but it only really tells you which part of your code is not yet covered.
What it does not tell you is if the current coverage is really testing or just passing over code.
Enters mutation testing! By changing parts of the tested code, it checks that related unit tests covering it should fail. If not, then the test does not really test anything, it just passes over the code.
Run npm run test:mutations
and check the generated Stryker Mutator in the reports
directory.
Look for surviving mutants, and test them one by one by replicating the mutation on our code and then if necessary, fix it.
Fixing means either adding meaningful assertions, or removing code that is not really useful.
npm run newman
I also added a Postman collection to give you something to test the API with.
I find it great for APIs because:
Also my goal is to automate this with Newman.
Well, I’m honored you are even thinking about contributing to this project 🤗
This is one of many side project, made for fun, and to explore some concepts and technology I was not using on my daily job.
I will not be actively maintaining it, just looking from afar, coldly, waiting for your contributions (issues, comments, questions, PRs…), or for my curiosity to arise again.
I do not have set up a proper CONTRIBUTING.md guide 🤭 so let’s just say all contributions are welcomed 😉. You should follow our Code of Conduct 🤝. Use the GitHub platform 😎:
Anyway, I will review any PRs and do my best to provide answers and make merging happen, and clarify the CONTRIBUTING rules using a test & learn approach as the need arise.
You can of course message me on Twitter @doppelganger9.
Author: doppelganger9
Source Code: https://github.com/doppelganger9/babyfoot
#nodejs #node #javascript