Simple but powerful Apps Script Unit Test library

1,141 views
Skip to first unread message

Bruce Mcpherson

unread,
May 22, 2022, 9:48:35 AM5/22/22
to Google Apps Script Community
I haven't posted any new code for a while, as I'm working on something more complex that usual which I'll start writing some articles about in the next few weeks.

In the meantime - here's my unit test library for Apps Script.

There are many test packages for Node (my favorite is [ava](https://github.com/avajs/ava)) and there are also a few for Apps Script but I couldn’t find one that was exactly what I was after, so I’ve released the one I use as a library. Unit testing your code as you go along will make it easier to find errors right away, check results are as expected, and keeping a running repertoire of tests ensures that you don’t break anything when you make changes.

https://ramblings.mcpher.com/gassnippets2/simple-unit-test-library/

dimud...@gmail.com

unread,
May 22, 2022, 10:04:54 AM5/22/22
to Google Apps Script Community
"I'm working on something more complex that usual which I'll start writing some articles about in the next few weeks"

Can you give us a hint as to what you're working on? 

Bruce Mcpherson

unread,
May 22, 2022, 12:35:54 PM5/22/22
to Google Apps Script Community
Yes - I'm working on a proxy for urlfetch that has caching, rate limiting and bunch of other stuff built in and along with that a library of one liner api access classes. Nearly there.

Paul Armstrong

unread,
May 23, 2022, 8:23:17 PM5/23/22
to Google Apps Script Community
Hi
That is very generous. 
I had to create my own, and it is not very good, as I do not have the time to invest. Being newish to Javascript (having come from Java), I missed having a decent test framework.
Thank you! 

Bruce Mcpherson

unread,
May 24, 2022, 6:09:05 AM5/24/22
to google-apps-sc...@googlegroups.com
You're welcome. Good luck with Apps Script.


--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/6a35ae61-8285-4a2b-8d5d-e11926ddce8en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages