Skip to content
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 #1

Open
rictic opened this issue Jan 22, 2022 · 3 comments
Open

Testing #1

rictic opened this issue Jan 22, 2022 · 3 comments

Comments

@rictic
Copy link

rictic commented Jan 22, 2022

Any advice on how to write an integration test of a ts plugin?

Currently considering using ttypescript, or just manually hooking up a typescript compiler using the API

@orta
Copy link
Owner

orta commented Jan 22, 2022

II'd probably try using the compiler API 👍🏻

@rictic
Copy link
Author

rictic commented Feb 4, 2022

I ended up going with just integration testing it inside of VS Code, which is working well, and gives assurance that the entire thing is working end to end. See runem/lit-analyzer#229 and runem/lit-analyzer#232

The only hacky part is that I haven't figured out a clean way to wait for the TS server to come online and begin responding to editor requests, and have resorted to polling until the results look right. Any ideas?

@rictic
Copy link
Author

rictic commented Feb 9, 2022

Update on that: in order to test that the plugin works after packaging, I've added a step to build a vsix file, unzip it outside of the repo dir, and then point @vscode/electron at that. This caught a tricky bug, where due to a dep erroneously being put into developmentDependencies, our plugin was working fine in development but would not boot after packaging. See: runem/lit-analyzer#233

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants