lnreader-plugins icon indicating copy to clipboard operation
lnreader-plugins copied to clipboard

jest tests for plugins

Open CD-Z opened this issue 1 year ago • 7 comments

Helps get a general overview which plugins work and which do not.

However it is not completely consistent. For example:

  • LightNovelPub:
    • works in app
    • doesn't work in web
    • works partly in tests
  • RanobeLib:
    • doesn't install in app
    • works in web
    • doesn't work in tests

I tried to figure out why this is, but wasn't able to.

CD-Z avatar Jul 06 '24 19:07 CD-Z

When we should run this script? Is it better than just waiting for user's report when some plugins not working

nyagami avatar Jul 17 '24 15:07 nyagami

My initial intension was to have it automatically run and mark broken plugins as broken, but for some reason it isn't that reliable. Maybe if someone who knows more about plugins looks at it, it can become more reliable.

CD-Z avatar Jul 17 '24 16:07 CD-Z

There are many plugins requires cookies to obtain data, even some requires authentication. Also because of different networking handler, some work in the app but not in the web.

nyagami avatar Jul 17 '24 16:07 nyagami

We could exclude them, then we would at least had a few automted or just close the pr. The main reason i created it was because i wanted to work a bit with jest.

CD-Z avatar Jul 17 '24 16:07 CD-Z

Imo unit tests is used for functionalities testing.

It should have test cases where plugin should pass (success or fail as expected).

And the test input data should be staticly prepared. Which means you just need to provide some random html files or json object via a local server (could be a proxy).

I think you are testing both plugin functionalities and availability.

nyagami avatar Jul 17 '24 17:07 nyagami

But if you still want to test plugin availability, i recommend using some tools like selenium or puppeteer.

nyagami avatar Jul 17 '24 17:07 nyagami

Yeah i agree, i will probably look into that again in the future, but currently i have not enough time for that.

CD-Z avatar Jul 17 '24 18:07 CD-Z