-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve JavaScript code test coverage #754
Comments
If someone experienced in JS would like to propose a solution, go for it! @blatinier you seemed to be interested in migrating (some) of the client code to VanillaJS or something similar - let's start by covering the existing code ;) |
@stefangehn @vincentbernat @pellenilsson @rocka @Lucas-C pinging you for recommendations/insights into JS testing. Baring any rewrite that gets rid of RequireJS/almond, the testing framework/solution/... should be compatible with these technologies. I'll throw jest into the room, not having any particular experience with it but it looks well-supported. |
I can confirm that, in my experience, |
That's great to hear! Do you have any particular examples of similar usage which might help in implementing testing for Isso? In any case, we'd also have a need of bringing up the server part (via docker?) to test out responses (or find a way to mock them). |
No I don't have any useful example at hand... However, what would you think about also introducing a code linter as part of the GitHub Actions pipeline? |
No worries, maybe someone else has.
I'm not at all opposed to that. But same goes for linters as @jelmer and me wrote in #756 - adding automatic code "quality" analysis tools is nice and all, but that still means not one line of actual tests has been written. I feel like every time we bring up this issue, the answer seems to be to add some "magic sauce" to this repo... Not a criticism of you, @Lucas-C, just an observation that the issue of missing tests is so broad and open-ended (many decisions to make, lots to write) that we tend to lose ourselves in easy fixes and digressions. So my approach would be for us to settle on something, anything, even if it's imperfect, and begin writing tests to have some basic coverage. To do that, we'd need a way to specify what we want to have covered. Common user interactions, moderation actions, missing/malformed server responses, comparison of generated client HTML, ... |
I fully agree with you @ix5! I had a quick look at the Javascript code, and DOM manipulation seems closely tied to isso functional logic 😔 I see several options:
Given the very reduced activity on isso over the past years, I admit that I personnaly don't feel motivated to invest much time in this task, but I'd be happy to discuss & review PRs to move forward in any of those direction 😊 |
@Lucas-C thank you for your insights! I have managed to make some strides in reducing the interdependence and modernizing the codebase a bit. To have any chance of integrating Isso with an existing testing framework, I feel like this is a blocking necessity. I've dropped |
Progress reportAs of now, my branch has a complete port to CommonJS syntax instead of the previous RequireJS-style Jest is set up and I have a few simple tests configured, which can import some Isso modules and pass. Anything relying on |
@Lucas-C @stefangehn (and anyone else interested) feel free to contact me at the email address listed on my website (contact section), I'd love to talk to you about this and have a few questions. Sadly, the IRC channel |
@ix5 Wow, thanks for all the work. My attempt to replace jade with pug (without touching the other cruft) totally failed as I can read JS but otherwise have zero knowledge about the whole JS ecosystem and its rapid change from one technology to another. I'm actually around on IRC, you can ping me ( |
Also of note: https://github.com/jGleitz/isso-clientlib by @jGleitz Would be great to somehow pull in a few tests of that hugely impressive effort. It's a shame that so many great initiatives live in outside or forked repos and seldomly manage to make their way into upstream Isso. |
Pinging @Lucas-C and @stefangehn (and maybe @Kerumen) now that a working test suite for the client part is in place. Would be really great if e.g. @Lucas-C could focus on the unit testing part and @Kerumen on the integration testing part? I have finally managed to document how to set up and run the test suite(s), see: |
Just want to note this down here before I forget, it would be nice to look into using Codecov which can show test coverage on pull requests. It's a pretty popular bot which I've seen on many other open source projects. |
I'm also very partial to having coverage be more visible. However, adding a dependency on an external proprietary service still doesn't sit quite right with me. Points of reference: Jest has |
I think coverage is at an acceptable level now. Closing. |
There is barely any test coverage for the javascript code at the moment. It would be great to at least have some basic tests to validate that the code is valid, and ideally also that it makes the right HTTP requests.
Edit: (addded by @ix5)
Related PRs
The text was updated successfully, but these errors were encountered: