2.7.42 • Published 10 months ago

ask-sdk-test v2.7.42

Weekly downloads
34
License
MIT
Repository
github
Last release
10 months ago

Alexa Skill Test Framework

npm version

This framework makes it easy to create full-coverage black box tests for an Alexa skill using Mocha.

Here's an example of what a test might look like with the test framework.

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 by Brian MacIntosh and rewritten for Typescript and the ASK SDK v2.

2.7.42

10 months ago

2.7.41

10 months ago

2.7.40

10 months ago

2.7.39

10 months ago

2.7.38

10 months ago

2.7.37

11 months ago

2.7.36

11 months ago

2.7.33

12 months ago

2.7.32

12 months ago

2.7.35

11 months ago

2.7.34

11 months ago

2.7.31

12 months ago

2.7.30

1 year ago

2.7.29

1 year ago

2.7.28

1 year ago

2.7.27

1 year ago

2.7.26

1 year ago

2.7.25

1 year ago

2.7.24

1 year ago

2.7.23

1 year ago

2.7.22

1 year ago

2.7.21

1 year ago

2.7.20

1 year ago

2.7.19

1 year ago

2.7.18

1 year ago

2.7.17

1 year ago

2.7.16

1 year ago

2.7.15

1 year ago

2.7.14

1 year ago

2.7.13

1 year ago

2.7.12

1 year ago

2.7.11

1 year ago

2.7.4

2 years ago

2.7.3

2 years ago

2.7.6

2 years ago

2.7.5

2 years ago

2.7.8

2 years ago

2.7.7

2 years ago

2.7.9

2 years ago

2.7.2

2 years ago

2.7.0

2 years ago

2.7.1

2 years ago

2.6.0

4 years ago

2.5.0

5 years ago

2.4.0

5 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago