NMF-earth / nmf-app

Understand and reduce your carbon footprint 🌱 iOS & Android.
https://nmf.earth
GNU General Public License v3.0
508 stars 157 forks source link

Add tests #382

Closed ghost closed 1 year ago

ghost commented 1 year ago

✅ I have read the contributing file

Summary

Hello, I'm a student in Computer Science and one of my lecturers charge me of choosing an open source application and just writing test on it. NMF-earth is the app I chose.

That's why I went a bit through the code and notice there might be some missing tests, specifically in the utils files. Here's why I wrote new unit tests with the assistance of Stryker, the mutation testing framework. Finally, I wanted to made tests on the user interaction, and so I designed one test for it in the screens.

This pull request is then essentially some test added to the app. Don't hesitate to contact me for any question and excuse me if I made some good practice mistakes, it's the first time I program with react-native 😉.

ghost commented 1 year ago
👇 Click on the image for a new way to code review #### [![Review these changes using an interactive CodeSee Map](https://s3.us-east-2.amazonaws.com/maps.codesee.io/images/github/NMF-earth/nmf-app/382/bfb65a60/04eba9b305835feaa5374152c853176459775cc6.svg)](https://app.codesee.io/r/reviews?pr=382&src=https%3A%2F%2Fgithub.com%2FNMF-earth%2Fnmf-app) #### Legend CodeSee Map legend
PierreBresson commented 1 year ago

Hello @JohanRochet 👋 Thanks for having a look :) Could you use jest instead of Stryker so we don't add any extra dependency?

ghost commented 1 year ago

I just deleted the dependency with stryker, unfortunately the interaction tests I wrote in MyLocationScreen.test.tsx require the use of React Native Testing Library which as far as I know can not be replaced by Jest. Do you want me to delete those tests or is it ok for you ?

PierreBresson commented 1 year ago

Closing for inactivity