freyr is bundled with its own flexibly customizable test runner.
-
To run all tests
npm test -- --all
-
To run just Spotify tests
npm test -- spotify
-
To run just Apple Music artist tests
npm test -- apple_music.artist
-
You can use a custom test suite (see the default suite for an example)
npm test -- --all --suite ./special_cases.json
-
And optionally, you can run the tests inside a freyr docker container
npm test -- deezer --docker freyr-dev:latest
-
You can customize the working directory for storing the tracks and logs
npm test -- spotify.track --name run-1 --stage ./test-runs
freyr-test
----------
Usage: freyr-test [options] [<SERVICE>[.<TYPE>]...]
Utility for testing the Freyr CLI
Options:
SERVICE spotify / apple_music / deezer
TYPE track / album / artist / playlist
--all run all tests
--suite <SUITE> use a specific test suite (json)
--docker <IMAGE> run tests in a docker container
--help show this help message
Enviroment Variables:
DOCKER_ARGS arguments to pass to `docker run`
Example:
$ freyr-test --all
runs all tests
$ freyr-test spotify
runs all Spotify tests
$ freyr-test apple_music.album
tests downloading an Apple Music album
$ freyr-test spotify.track deezer.artist
tests downloading a Spotify track and Deezer artist