https://github.com/fossamagna/gas-test-cli
CLI for gas-test
https://github.com/fossamagna/gas-test-cli
google-apps-script
Last synced: 3 months ago
JSON representation
CLI for gas-test
- Host: GitHub
- URL: https://github.com/fossamagna/gas-test-cli
- Owner: fossamagna
- Created: 2016-09-21T14:57:18.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-12-30T06:25:40.000Z (6 months ago)
- Last Synced: 2025-01-04T14:52:52.838Z (6 months ago)
- Topics: google-apps-script
- Language: JavaScript
- Size: 85.9 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gas-test-cli [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
> CLI for [gas-test](https://github.com/fossamagna/gas-test)
## Installation
First, install gas-test-cli using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).
```sh
npm install gas-test-cli --save-dev
```## Usage
1. Get Credentials for Google Apps Script Execution API.
```sh
$(npm bin)/gas-test auth
```
2. Create settings file.Note: Change to `scopes` values used by your test script.
gas-test.json:
```
{
"scriptId": "",
"scopes": ["https://www.googleapis.com/auth/drive"]
}
```3. Build test code.
Options:
- `-t`, `--typescript`: transpile with TypeScript
- `-b`, `--babel`: transpile with babel```sh
$(npm bin)/gas-test --typescript build test/*.ts -o built.js
```4. Push test code via Google Apps Script API
```sh
$ clasp push
```
[clasp](https://github.com/google/clasp) is useful in order to push script to project on Google.5. Run test code using gas-test via Execution API.
```sh
$(npm bin)/gas-test run -c -s -o
```## License
Apache-2.0 © [fossamagna](https://github.com/fossamagna)
[npm-image]: https://badge.fury.io/js/gas-test-cli.svg
[npm-url]: https://npmjs.org/package/gas-test-cli
[travis-image]: https://travis-ci.org/fossamagna/gas-test-cli.svg?branch=master
[travis-url]: https://travis-ci.org/fossamagna/gas-test-cli