-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Add tests #26
Comments
I would like to see tests too, although I’m not sure if unittests are the right way to test this. I think this would require a lot of stubbing which doesn’t really test the functionality in the end. Perhaps end to end tests using Cypress are a good option? |
Thanks @domsew for adding an initial test setup using Playwright! I’m not closing this issue yet, as we should add tests for every feature provided. By this I mean we need to add tests for every language feature provided (make sure hovers info, links, etc work). We don’t need to add tests for upstream |
Hello, I found some time to follow up the code coverage topic from this question. Basically there are two possible approaches:
I tested both approaches and they produce slightly different results. You can track my experiments here. And here you can find four example reports I got: coverage.zip. In case of V8 the setup is pretty simple. I extended the example from the docs by adding code to generate and save report (function I also made an attempt to instrument code for
Unfortunately in both scenarios I was unable to get code coverage of Web Workers. Moreover, I tested Cypress. In comparison to Playwright, it has dedicated code coverage plugin, but doesn't support V8 coverage and custom instrumentation is still required. Futhermore Cypress requires more boilerplate code and doesn't support native events like Before I prepare a PR I need to ask the following questions:
|
@remcohaszing could you take a look at my comment? I also want to mention that there is an open issue about |
Sorry, I missed those last comments somehow. I created Also I welcome anyone to contribute more tests. It would be nice to have at least one test per provider. That would cover most code already. For inspiration you may want to have a look at the |
I realized that all the tests in the
test
directory are actually tests for theyaml-language-server
and there are actually no tests for this repo. There should defintely be test coverage for the yaml plugin we're creating here.The text was updated successfully, but these errors were encountered: