To run integration tests locally you will need a Custom App
created at https://cloud.app.box.com/developers/console
with Server Authentication (with JWT)
selected as authentication method.
Once created you can edit properties of the application:
- In section
App Access Level
selectApp + Enterprise Access
. You can enable allApplication Scopes
. - In section
Advanced Features
enableMake API calls using the as-user header
andGenerate user access tokens
.
Now select Authorization
and submit application to be reviewed by account admin.
There are two ways to set up JWT configuration:
- First method:
- Select
Configuration
tab and in the bottom in the sectionApp Settings
download your app configuration settings as JSON. - Specify the path to the JWT config file in
test-config.json
, e.g."jwt_file_path": "/Users/me/jwt-config.json"
- Specify id of admin user account in
test-config.json
, e.g."admin_user_id": "13855142101"
- Alternatively:
- Select
Configuration
tab and in the bottom in the sectionApp Settings
download your app configuration settings as JSON. - Encode configuration file to Base64, e.g. using command:
base64 -i path_to_json_file
- Set environment variable:
JWT_CONFIG
with base64 encoded jwt configuration file - Set environment variable:
ADMIN_USER_ID
with id of admin user account
To run integration tests, you can run command:
npm run jest