stub-azure-function-context
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -93,2 +93,3 @@ "use strict"; | ||
}, | ||
...data.params, | ||
}; | ||
@@ -95,0 +96,0 @@ } |
@@ -5,3 +5,3 @@ import { Binding } from '../types'; | ||
id: string; | ||
queueTrigger: string; | ||
queueTrigger: string | object; | ||
dequeueCount: number; | ||
@@ -23,3 +23,3 @@ expirationTime: string; | ||
export declare class QueueBinding implements Binding { | ||
static createFromMessageText(queueTrigger: string): QueueBinding; | ||
static createFromMessageText(queueTrigger: string | object): QueueBinding; | ||
static createFromDequeuedMessageItem(messageItem: DequeuedMessageItem): QueueBinding; | ||
@@ -29,3 +29,3 @@ private readonly data; | ||
toContextBinding(): ContextBindings; | ||
toTrigger(): string; | ||
toTrigger(): string | object; | ||
toBindingData(): ContextBindings; | ||
@@ -32,0 +32,0 @@ } |
{ | ||
"name": "stub-azure-function-context", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "Provides an object similar to Function Runtime's context for use in unit testing", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -61,3 +61,3 @@ # stub-azure-function-context | ||
The `toTrigger()` method returns the object/value that is passed to the Azure Function as the second parameter. | ||
For example, queue triggers are just the message text. | ||
For example, queue triggers are the message text or objects (in servicebus queue). | ||
@@ -166,3 +166,3 @@ The `toContextBinding()` method should return the object shape that is bound to the `bindingData` property of the context | ||
}))); | ||
const context = await runStubFunctionFromBindings(functionToTest, [ | ||
const context = await functionRunner(functionToTest, [ | ||
{ name: 'myInput', direction: 'in', type: 'queueTrigger' } | ||
@@ -174,3 +174,3 @@ ], { myInput: QueueBinding.createFromDequeuedMessageItem(message) }); | ||
const messageText = 'my-other-message'; | ||
const context = await runStubFunctionFromBindings(functionToTest, [ | ||
const context = await functionRunner(functionToTest, [ | ||
{ name: 'myInput', direction: 'in', type: 'queueTrigger' } | ||
@@ -177,0 +177,0 @@ ], { myInput: QueueBinding.createFromMessageText('my-other-message') }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
54685
632