openfoodfacts / openfoodfacts-nodejs

Official Node package for Open Food Facts
https://openfoodfacts.github.io/openfoodfacts-nodejs/
Apache License 2.0
148 stars 27 forks source link

test: configure unit tests with jest runner and add unit tests for Nutripatrol wrapper #540

Closed bengeois closed 3 weeks ago

bengeois commented 1 month ago

What

This merge request replaces the existing test setup (Mocha, Sinon, and Chai) with Jest as the primary testing framework for the project.

Jest combines testing, assertions, and mocking in a single framework, reducing the need for multiple dependencies (mocha, sinon, chai). It also has better performance and is can be configured with typescript easier.

Fixes bug(s)

Fixes https://github.com/openfoodfacts/openfoodfacts-nodejs/issues/276

teolemon commented 4 weeks ago

test

VaiTon commented 3 weeks ago

@bengeois please rebase and then we're good!

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

bengeois commented 3 weeks ago

Thanks @VaiTon !