mock-alexa-dynamo

0.2.5 • Public • Published

Build Status

Mock Alexa Dynamo

For users of the Alexa Node.js SDK.

Super simple library for mocking out Dynamo dependency.

Installation

To use it, install with:
npm install mock-alexa-dynamo --save

Usage

Initialize

Then enable:

const mockDynamo = require("mock-alexa-dynamo");
mockDynamo.enable();

Presetting State

State can be pre-configured at the start by calling the load method:

mockDynamo.load("USER_ID", { userInfo: {} })

This would typically be called in a beforeEach block in a unit-test.

Resetting State

Between tests, to reset the state, just call:

mockDynamo.reset();

Typically, this would be placed inside a afterEach method in a unit-test.

Example

To see a full example, check out the Giftionary project:
https://github.com/bespoken/giftionary

In particular, this test:
https://github.com/bespoken/giftionary/blob/master/test/index.test.js

Readme

Keywords

none

Package Sidebar

Install

npm i mock-alexa-dynamo

Weekly Downloads

1

Version

0.2.5

License

SEE LICENSE IN LICENSE

Unpacked Size

4.22 kB

Total Files

3

Last publish

Collaborators

  • jpkbst