gas-test-cli

0.6.0 • Public • Published

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

/gas-test-cli/

    Package Sidebar

    Install

    npm i gas-test-cli

    Weekly Downloads

    19

    Version

    0.6.0

    License

    Apache-2.0

    Unpacked Size

    14.7 kB

    Total Files

    12

    Last publish

    Collaborators

    • fossamagna