labnol / apps-script-starter

Setup a local development environment inside Visual Studio Code and build Google Workspace add-ons with Google Apps Script
https://www.youtube.com/watch?v=KxdCIbeO4Uk
MIT License
1.1k stars 176 forks source link

Unit Test & Integration Test #9

Closed SunHuawei closed 1 year ago

SunHuawei commented 5 years ago

Hey there, it's really glad to see this repo. It's easy to start, especially to me, new to GS. It saves me hours.

But I find there is no test solution in this repo. Is there possible to add unit test for it? Or integration test?

I know it may be out of this repo's scope, but I'd also like to discuss with you.

oshliaer commented 5 years ago

@SunHuawei

maybe it makes sense to connect tests in addition to the build?

As a plugin.

jwermuth commented 3 years ago

I have added mocha tests to mine. I can not test the code when running on GCP, but it tests the code before. I use it to tests main algorithms. Having that level of tests saves me a lot of time. Ill be happy to make a PR with it, but I would like @labnol to indicate that he will look at the PR once it comes before i start working on this

jwermuth commented 3 years ago

Added PR #46 . Looking forward to your comments. @SunHuawei while the PR is being considered, you could have a look at the code and manually move it into you own code if you want.

votungphan commented 3 years ago

I'm very glad to see this Git. Besides the feature-rich mocha testing framework suggested by @jwermuth, it's good to consider to support Jest testing framework as its simplicity. It also makes sense to support the GAS testing when running deploy. I think GSUnit or GAST is a good started. Thanks!

jwermuth commented 3 years ago

Thanks for the input @votungphan. I have looked at little at the 2 frameworks, and give it a shot at adding GAST to this PR. I favor GAST over GSUnit because GAST is TAP compatable. I do not think mocha is TAP compatable. If GAST is a success I ?might consider adding a TAP compliant javascript test framework, so all testing is TAP compatable

jwermuth commented 3 years ago

@labnol you are welcome to assign me to this issue. I believe there is working code to merge right now, and more will come when I have some time to add more example test-frameworks.

jwermuth commented 3 years ago

After investigating the jest framework I find it better than mocha and have decided to close PR #46 and replace it with PR #50. PR #50 implements jest tests with a simple example test. @votungphan thanks for the input.

labnol commented 1 year ago

This issue is closed due to no recent activity. If you are encountering a similar issue, please create a new one. Thank you.