How about some javascript tests with jest ? #2314
TrimmingFool
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
I think we should go for it, if @Novik doesn't have any objections. Would you mind waiting a couple weeks though? I would like to get anther pre-release of ruTorrent created to transition more users to version 4. This has a very high potential to introduce regressions. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@Novik @stickz
For sane refactoring you need some tests.
Even though ruTorrent is quite old and does not use ES modules, it is still possible to test some functionality in isolation, e.g., the xmlrpc response parsing in
js/rtorrent.js
with jest + jsdom + jquery.I did this here to test the refactoring of
js/rtorrent.js
withtests/js/rtorrent.spec.js
:TrimmingFool/pull/1
Reference: https://github.com/facebook/jest/tree/main/examples/jquery https://jestjs.io/docs/tutorial-jquery
Nevertheless, I also see merit in the strategy of keeping things as they are and just avoiding refactoring. (since everything is so old)
(Also at the moment I personally do not have any further refactorings in mind)
Beta Was this translation helpful? Give feedback.
All reactions