Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taimos/ask-sdk-test
Alexa Skill Test Framework for Typescript and ASK2
https://github.com/taimos/ask-sdk-test
alexa alexa-sdk test-framework
Last synced: 8 days ago
JSON representation
Alexa Skill Test Framework for Typescript and ASK2
- Host: GitHub
- URL: https://github.com/taimos/ask-sdk-test
- Owner: taimos
- License: mit
- Created: 2018-12-04T00:35:47.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-08T00:07:51.000Z (7 months ago)
- Last Synced: 2024-04-14T05:52:52.939Z (7 months ago)
- Topics: alexa, alexa-sdk, test-framework
- Language: TypeScript
- Size: 1.08 MB
- Stars: 21
- Watchers: 4
- Forks: 12
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Alexa Skill Test Framework
[![npm version](https://badge.fury.io/js/ask-sdk-test.svg)](https://badge.fury.io/js/ask-sdk-test)
This framework makes it easy to create full-coverage black box tests for an Alexa skill using [Mocha](https://mochajs.org/).
Here's an example of what a test might look like with the test framework.
```typescript
import {AlexaTest, IntentRequestBuilder, LaunchRequestBuilder, SkillSettings} from 'ask-sdk-test';
import {handler as skillHandler} from './helloworld';// initialize the testing framework
const skillSettings : SkillSettings = {
appId: 'amzn1.ask.skill.00000000-0000-0000-0000-000000000000',
userId: 'amzn1.ask.account.VOID',
deviceId: 'amzn1.ask.device.VOID',
locale: 'en-US',
};const alexaTest = new AlexaTest(skillHandler, skillSettings);
describe('LaunchRequest', () => {
alexaTest.test([
{
request: new LaunchRequestBuilder(skillSettings).build(),
says: 'Welcome to the Alexa Skills Kit, you can say hello!',
repromptsNothing: true,
shouldEndSession: true,
},
]);
});
```If you are writing your Alexa Skills in Python, check out https://github.com/BananaNosh/py_ask_sdk_test
## How To
Install the package as a dev dependency with `npm install ask-sdk-test --save-dev`.Write tests in a Typescript file and run them with Mocha. For example, if your test is at 'test/skill.spec.ts', run `mocha --require node_modules/ts-node/register/index.js test/skill.spec.ts`.
For some simple examples, see the 'examples' directory.
## History
This framework is based on the [alexa-skill-test-framework](https://github.com/BrianMacIntosh/alexa-skill-test-framework) by Brian MacIntosh and rewritten for Typescript and the ASK SDK v2.