0.6.0 • Published 4 years ago

gas-test-cli v0.6.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
4 years ago

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>
  2. 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"]
    }
  3. 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
  4. Push test code via Google Apps Script API

    $ clasp push

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

  5. 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