项目作者: fossamagna

项目描述 :
CLI for gas-test
高级语言: JavaScript
项目地址: git://github.com/fossamagna/gas-test-cli.git
创建时间: 2016-09-21T14:57:18Z
项目社区:https://github.com/fossamagna/gas-test-cli

开源协议:

下载


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

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

Usage

  1. Get Credentials for Google Apps Script Execution API.
    1. $(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:

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

    Options:

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

    1. $ clasp push

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

  5. Run test code using gas-test via Execution API.

    1. $(npm bin)/gas-test run -c <path to credentials> -s <path to gas-test.json> -o <path to output>

License

Apache-2.0 © fossamagna