Testing

Tests are written in Jasmine, there are Unit, Integration, and Benchmark tests.

To iterate on tests in Node, run npm run test or npm run test:coverage to test with coverage reporting.

To iterate on tests in a browser, run npm run start. Jasmine can isolate to a specific test either by temporarily using fit or fdescribe (read f for focus) in the test, or by providing a filter.

When running tests in a browser, here are the possible queryString parameters:

When running tests in a browser, the window must remain in the foreground. This is in order to have consistent timeupdate events and prevent auto-pausing muted audio/video.

BrowserStack

To test on BrowserStack, add your BrowserStack credentials to a .env file in the project root.

This should be in the form:

BROWSERSTACK_USERNAME=nicholasbilyk_aaBBccDD
BROWSERSTACK_ACCESS_KEY=ga3sa6toGyabcves586a

Your username and access key can be obtained by logging in and clicking the Access Key link at the top.

For browser/device combinations that require SSL, the DEVELOPER_SETUP.md Setup SSL setup must be completed.

To run tests on BrowserStack, run npm run test:browserstack.

BrowserStack test logs can be found in the bStackLogs directory. This directory is safe to delete.

Integration Tests

Integration tests can be run in a browser for the current dev and prod releases.

To run integration tests with reporting to CloudWatch (useful for testing external devices), add ?reportCw=true to the querystring. Logs will be posted to vinyl-dev.

Dev Build

To publish a dev build to S3 for testing the demo player on external devices, run a build either via npm run build or npm run start, then run the script: tsx ./buildSrc/pushDevBuildToS3.ts to deploy the local demo build to https://dev.vinyl.music.amazon.dev/devBuild//index.html