Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

NordicSemiconductor/nrfcloud-location-services-tests-js

Note

This repository has been archived, because it is considered feature-complete. ✔️

nRF Cloud Location Services tests npm version

GitHub Actions semantic-release Renovate @commitlint/config-conventional

Tests the nRF Cloud Location services

Configure these environment variables:

  • API_HOST (optional, endpoint to run the tests against)
  • TEAM_ID
  • LOCATION_SERVICES_SERVICE_KEY

Then run:

npm ci
npm run test

Authentication using Evaluation Token

For evaluation purposes, users can generate an evaluation token (see the nRF Cloud Location Services documentation for further information.)

evaluation-token-authentication.spec.ts demonstrates the usage of an evaluation token to authenticate requests.

For this test you need to configure the environment variable EVALUATION_TOKEN, which contains your nRF Cloud Location Service Evaluation Token.

Device Token Authentication

⚠️ Using REST with JWT on a cellular device is not recommended because this protocol (REST using TLS with JWT authentication) has a very large overhead. MQTT is recommended for cellular devices.

device-token-authentication.spec.ts demonstrates the usage of per-device tokens to authenticate requests.

The tests register a private key for a virtual device and use that key to sign a JWT.

For this test you need to configure the environment variable API_KEY, which contains your nRF Cloud REST API key.