Skip to content

Latest commit

 

History

History

test

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Tests

clasp's CLI commands have unit tests that:

  • Run the clasp command
  • Compares the expected stdout text and stderr code

Testing Tools

How to Run Tests

  1. Log in: clasp login
  2. Rebuild: npm run build
  3. Set environmental variables:
    • export SCRIPT_ID=1EwE84eZCSBPcaAiJzCnDjmxMVnLQrDyhSKq1oZY6q-3x4BIDHgQefCnL
    • export PROJECT_ID=project-id-3961473932623644264
  4. Test: npm run test

Configuration using Travis

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.

Clasp login

Since CI can not log in, a .clasprc.json file is included that was created locally using clasp login.

Use test account [email protected]. Password is private.

When updating the credentials, save the contents of the file in the github secret DOT_CLASPRC.

Testing Status

This section tracks which clasp commands are tested. Unchecked checkboxes are test cases that still need to be added.

Commands

  • 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

Configs

  • .js, .gs, .ts files
  • Ignored files