1.5.9 • Published 1 year ago

jalexa v1.5.9

Weekly downloads
5
License
MIT
Repository
github
Last release
1 year ago

Jalexa

Easily create unit tests for alexa skills.

npm Release Maintainability Join the chat at https://gitter.im/jest-alexa/community Rate this package

Installation

Jalexa uses the ask-cli to make requests to your skill. Before running tests with jalexa you need to install and authenticate the ask-cli. You can find out more here: https://www.npmjs.com/package/ask-cli

Once the ask cli is configured, you just need to install jalexa in your project:

yarn add -D jalexa

Then add it to your setup files in jest.config.js:

module.exports = {
  setupFilesAfterEnv: ["jalexa/dist/matchers"],
  ...
};

Testing

To test your skill, you'll just need the skill id:

import { AlexaSkill, RequestTypes } from "jalexa";

describe("Basic skill test", () => {
  test("Can start conversation", async () => {
    const skill = new AlexaSkill({
      skillId: "amzn1.ask.skill.YOUR_SKILL_ID",
    });

    const response = await skill.speak("open my skill");

    expect(response).toBeSuccessful();
    expect(response).toBeRequestType(RequestTypes.LaunchRequest);
  });
});
1.5.9

1 year ago

1.5.8

1 year ago

1.5.7

1 year ago

1.5.6

1 year ago

1.4.0

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago