clasp's CLI commands have unit tests that:
- Run the
claspcommand - Compares the expected
stdouttext andstderrcode
- Testing framework: Mocha.js
- Testing CI: GitHub actions
- Unit tests run for every Pull Request
- Testing % coverage: Coveralls
- Log in:
clasp login - Rebuild:
npm run build - Set environmental variables:
export SCRIPT_ID=1EwE84eZCSBPcaAiJzCnDjmxMVnLQrDyhSKq1oZY6q-3x4BIDHgQefCnLexport PROJECT_ID=project-id-3961473932623644264
- Test:
npm run test
Note: The build may fail due to API quota limits. To solve this, wait 24 hours and then rebuild Travis.
GitHub automatically build and run tests on clasp for.
Since CI can not log in, a .clasprc.json file is included that was created locally using clasp login.
Use test account
claspcreds@gmail.com. Password is private.
When updating the credentials, save the contents of the file in the github secret DOT_CLASPRC.
This section tracks which clasp commands are tested. Unchecked checkboxes are test cases that still need to be added.
- clasp;
- clasp login';
- clasp login --no-localhost;
- clasp logout;
- clasp create "myTitle"
- clasp create <untitled>
- clasp list
- clasp clone <scriptId>
- clasp clone
- clasp pull
- clasp push
- echo '// test' >> index.js && clasp push
- clasp open
- clasp deployments
- clasp deploy [version][description]
- clasp version [description]
- clasp versions
- saveProject
- getScriptURL
- getLocalFileType
- getAPIFileType
- .js, .gs, .ts files
- Ignored files