A simple Amazon Alexa skill that demonstrates how to write unit tests with Jasmine. Read the companion article at medium.com.
- How to write a unit test around an Amazon Alexa skill intent.
- Mocking requests and responses.
- Testing if SSML responses are valid.
- Clone the git project. Project was built using node version 4.2.6.
- Go to the project directory
cd alexa-skill-unit-tests-js
- Install node modules
npm i
- Set up Jasmine
npm i jasmine-node -g
- Run tests
jasmine-node spec/
- Card validator.
- Max length of speech and card validator.
- SSML attribute value validator.
- Validate all SSML tags get closed properly.
- Unit tests around validators.