0.1.2 • Published 2 years ago

apigee-mocker-context v0.1.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

apigee-mocker-context

Node utility for unit testing JS files created on Apigee.

Used for unit testing Apigee JS files.

Usage:

const { context } = require("apigee-mocker-context");

context.import({ "request.content": "test"});

const clonedContext = context.export();

Usage in Apigee

Use the following structure in your JS files so you will be able easily import them in Node. It's important to return context

const thisModule = env => {
    const context = env.context
    //TODO: Insert your code
    return context;
}
if (typeof exports !== 'undefined') exports.thisModule = thisModule;
if (typeof context !== 'undefined') thisModule({ context: context }) = thisModule;
0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago