-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Testing #56
Comments
Thanks for opening this issue. We don't need to cover the whole api right now, but getting a first test in place would be really useful I think. |
@wipfli What's the way (in general) of testing things like this plugin? The plugin is dependant on the maplibre gl js, and I need to create a gl js map first to be able to pass it as a mandatory argument to the plugin's constructor, but I get WebGL or canvas-related errors (which is quite expectable TBH, but anyway). When using happy-dom as the environment, I get things like " Once again, I'm not nearly an expert in testing, so looking for some general recommendations. Maybe my chosen approach is incorrect by-design? |
The other thing. Testing now seems to be the only remaining thing that holds us from releasing the first major version. Maybe it's worth postponing it up to 1.x? What do you think? |
We had WebGL errors in the CI of GL JS as well. This was when running on ubuntu. We solved the problem with xvfb, see for example: I think we should have some minimal test coverage for the public API before we release version 1. When we go to this version we make a promise that breaking changes will be reflected by incrementing the major version. But without tests it will be hard to keep the overview. I think new people will find it easier to contribute if CI can check that their contributions don't break the API... |
@wipfli Totally agree with you. Let's postpone the v1 release until at least some tests are in place. And thanks for the link, I'll check it out a bit later. |
Current status upddate. I'm unable to test the plugin, because it requeres a map instance. An instance of MapLibre map cannot be created in test environment (tested with happy-dom, jsdom and node) due to errors with both canvas (though this one seems like could be solved) and web-workers, which are both crucial for MapLibre. |
@Miguel-Sanches, don't you want to participate in this one? I'm stuck with it (see the comment above), and v1 can't be released until this one is resolved. And the feature you've been working on for so long time can't get into the NPM package because of this blocking one. |
For some reason GitHub didn't notify me of this mention. I'll be happy to help out with anything needed |
@Miguel-Sanches that's wierd. On the other hand, we talked about that in Slack's DMs. Not much changed since then. Everything's in the very same state as it used to be back then. There's currently a (draft) PR by me where I started to poke around with testing. I think the best idea would be to use Vitest, but I can't get it to work (WebGL- and web-workers-related issues). Could you please try to check out whether something could be done on that account? Any help is appreciated: research, tests themselves, environment configuration, etc. Thanks in advance! |
Another option would be to use e2e testing. On one side that'd be even better (a more complex approach), on the other side it limits us from testing separate units (like helpers, though they're not the topmost priority at the moment). |
@smellyshovel Will try to have a look at it :) |
Maybe https://github.com/maplibre/maplibre-gl-geocoder could give some insights. Although tape should not be used anymore, I would rather go with jest for unit tests... |
Yeap, I'd prefer if we'd go with jest also. I'll try to take a look at maplibre-gl-geocode during the weekend |
The most crucial lib's parts should be covered with unit tests. That's the very least requirement till v1.
Write tests for:
The text was updated successfully, but these errors were encountered: