vscode-open-in-github icon indicating copy to clipboard operation
vscode-open-in-github copied to clipboard

Create tests for extension

Open bugthesystem opened this issue 9 years ago • 6 comments

https://code.visualstudio.com/docs/extensions/testing-extensions

bugthesystem avatar Jul 28 '16 16:07 bugthesystem

I am working on it :)

ziluvatar avatar Aug 15 '16 10:08 ziluvatar

hi @ziluvatar great, its good to hear that! 👍

bugthesystem avatar Aug 18 '16 10:08 bugthesystem

@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.

gdziadkiewicz avatar Aug 18 '16 14:08 gdziadkiewicz

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 avatar Aug 19 '16 14:08 ziluvatar

@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 avatar Aug 21 '16 09:08 gdziadkiewicz

@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

ziluvatar avatar Aug 21 '16 16:08 ziluvatar