apps-script-starter icon indicating copy to clipboard operation
apps-script-starter copied to clipboard

Unit Test & Integration Test

Open SunHuawei opened this issue 6 years ago • 7 comments

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.

SunHuawei avatar Jan 24 '19 09:01 SunHuawei

@SunHuawei

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

As a plugin.

oshliaer avatar Jul 08 '19 12:07 oshliaer

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 avatar Feb 26 '21 13:02 jwermuth

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.

jwermuth avatar Feb 27 '21 10:02 jwermuth

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!

votungphan avatar Mar 04 '21 07:03 votungphan

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 avatar Mar 08 '21 19:03 jwermuth

@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 avatar Mar 10 '21 07:03 jwermuth

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.

jwermuth avatar Apr 11 '21 08:04 jwermuth

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

labnol avatar Apr 06 '23 15:04 labnol