0.2.5 • Published 6 years ago

mock-alexa-dynamo v0.2.5

Weekly downloads
48
License
SEE LICENSE IN LI...
Repository
github
Last release
6 years ago

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

0.2.5

6 years ago

0.2.5-0

6 years ago

0.2.4-0

6 years ago

0.2.3-0

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.1-0

6 years ago

0.2.0-0

6 years ago

0.1.0-0

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago