Skip to content

Developing code for Google Apps Script can be fun, but not being able to test things or use a regular javascript pipeline can be quite annoying, here's a great template to get started!

License

mikfreedman/testable-apps-script

Repository files navigation

testable-apps-script

test

Developing code for Google Apps Script can be fun, but not being able to test things or use a regular javascript pipeline can be quite annoying.

This project uses a combination of

To create a workable javascript pipeline for your V8 Apps Script project.

Installation

First, enable the Google Apps Script API: https://script.google.com/home/usersettings

npm install

npm run clasp login # Setup clasp for pushing code to google

Create a .clasp.json in the root of the project that looks like this

{
  "scriptId": "[script id from url]",
  "rootDir": "dist/"
}

Then, update the Apps Script Manifest located here: src/appsscript.json

Development

src/addon.js is the main entrypoint of the application, add your code there!

Be sure to add functions that you want Google Apps Script to see to the global variable created at the top of the file.

global.newFunction = function() {
    console.log("newFunction")
}

Testing

npm test

Deploy

npm run deploy

About

Developing code for Google Apps Script can be fun, but not being able to test things or use a regular javascript pipeline can be quite annoying, here's a great template to get started!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published