# ask-sdk-test

> [![npm version](https://badge.fury.io/js/ask-sdk-test.svg)](https://badge.fury.io/js/ask-sdk-test)

Latest version **2.7.42** (published 2024-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install ask-sdk-test
pnpm add ask-sdk-test
yarn add ask-sdk-test
bun add ask-sdk-test
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.7.42 |
| Published | 2024-09-02 |
| First published | 2018-12-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 1.5 MB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 21 |
| Author | Taimos GmbH |
| Maintainers | hoegertn, taimos-user |
| Keywords | alexa, amazon, aws, black box, black-box, coverage, echo, mocha, offline, test |

## Links

- npm: https://www.npmjs.com/package/ask-sdk-test
- Repository: https://github.com/taimos/ask-sdk-test
- Homepage: https://github.com/taimos/ask-sdk-test#readme
- Issues: https://github.com/taimos/ask-sdk-test/issues
- npm.io page: https://npm.io/package/ask-sdk-test

## Dependencies (5)

- [nock](https://npm.io/package/nock.md) ^13.5.5
- [uuid](https://npm.io/package/uuid.md) ^9.0.1
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.1687.0
- [aws-sdk-mock](https://npm.io/package/aws-sdk-mock.md) ^5.9.0
- [lambda-local](https://npm.io/package/lambda-local.md) ^2.2.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 2.7.42 (latest) — 2024-09-02
- 2.7.41 — 2024-08-26
- 2.7.40 — 2024-08-19
- 2.7.39 — 2024-08-12
- 2.7.38 — 2024-08-05
- 2.7.37 — 2024-07-29
- 2.7.36 — 2024-07-22
- 2.7.35 — 2024-07-15
- 2.7.34 — 2024-07-08
- 2.7.33 — 2024-07-01
- 2.7.32 — 2024-06-24
- 2.7.31 — 2024-06-17
- 2.7.30 — 2024-06-10
- 2.7.29 — 2024-06-03
- 2.7.28 — 2024-05-27
- … 39 more at https://npm.io/package/ask-sdk-test/versions

## 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.

---
_Source: https://npm.io/package/ask-sdk-test · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
