Skip to content

fossamagna/gas-test-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gas-test-cli NPM version Build Status

CLI for gas-test

Installation

First, install gas-test-cli using npm (we assume you have pre-installed node.js).

npm install gas-test-cli --save-dev

Usage

  1. Get Credentials for Google Apps Script Execution API.
$(npm bin)/gas-test auth <client_secret.json>
  1. Create settings file.

Note: Change to scopes values used by your test script.

gas-test.json:

{
  "scriptId": "<YOUR_SCRIPT_ID_FOR_TEST>",
  "scopes": ["https://www.googleapis.com/auth/drive"]
}
  1. Build test code.

    Options:

    • -t, --typescript: transpile with TypeScript
    • -b, --babel: transpile with babel
$(npm bin)/gas-test --typescript build test/*.ts -o built.js
  1. Push test code via Google Apps Script API
$ clasp push

clasp is useful in order to push script to project on Google.

  1. Run test code using gas-test via Execution API.
$(npm bin)/gas-test run -c <path to credentials> -s <path to gas-test.json> -o <path to output>

License

Apache-2.0 © fossamagna