Create tests for extension
https://code.visualstudio.com/docs/extensions/testing-extensions
I am working on it :)
hi @ziluvatar great, its good to hear that! 👍
@ziluvatar I have also been working on that. Right now I am ready with testing using both Lauch Tests task and npm test, running the tests on TravisCI, testing the line feature and repo feature. I will create a PR in a momemnt, please see it and comment on potential merging it with your work.
I did not find the way of calling context menu items from code, so the file and directory options remains uncovered by tests. I can add tests for branch different than master.
Hi @gdziadkiewicz, hahaha, we should have talked each other before starting, anyway it helped me to learn about extension testing.
I've seen your PR already merged, I'll take a look to the merged code to look for improvements if it needs it in a couple of weeks (I am off this week and next one).
What I had prepared was testing the different providers (github, bitbucket and visualstudio.com), with a similar concept (instead of renaming .git -> git, I create a link .git -> .gitted), the way I test the context menu is faking vscode execution, so I run the command passing an args object (I don't like it too much because if vscode behaviour changes you won't notice the problem, but I couldn't find any other way).
This is the branch incase you want to take a look: https://github.com/ziluvatar/vscode-open-in-github/tree/testing/test It was working only for Launch Tests. Not sure if it is sync with the last changes the repo had in the last month.
@ziluvatar It's great to hear that you were able to test providers other than GitHub and implemented faking the object provided by vscode. Do you mind if I fork your repo, synchronize your work with my changes and do a PR? If you would rather do it yourself then I will be waiting to see it :) In the meantime I'm experimenting with running the tests on AppVeyor.
@gdziadkiewicz be free to play with it and create a PR, I won't have time to do anything related in the next week or so