-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for shared output bug (#30)
- Loading branch information
Showing
2 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
import { app, InvocationContext, output } from '@azure/functions'; | ||
|
||
// Test for bug https://github.com/Azure/azure-functions-nodejs-library/issues/179 | ||
|
||
const queueOutput = output.storageQueue({ | ||
queueName: 'e2e-test-queue-trigger', | ||
connection: 'e2eTest_storage', | ||
}); | ||
|
||
app.storageBlob('storageBlobTriggerReturnOutput', { | ||
path: 'e2e-test-container/e2e-test-blob-trigger-shared-output-bug', | ||
connection: 'e2eTest_storage', | ||
return: queueOutput, | ||
handler: (blob: Buffer, context: InvocationContext) => { | ||
context.log(`storageBlobTriggerReturnOutput was triggered`); | ||
return `${blob.toString()}-returnOutput`; | ||
}, | ||
}); | ||
|
||
app.storageBlob('storageBlobTriggerExtraOutput', { | ||
path: 'e2e-test-container/e2e-test-blob-trigger-shared-output-bug', | ||
connection: 'e2eTest_storage', | ||
extraOutputs: [queueOutput], | ||
handler: (blob: Buffer, context: InvocationContext) => { | ||
context.log(`storageBlobTriggerExtraOutput was triggered`); | ||
context.extraOutputs.set(queueOutput, `${blob.toString()}-extraOutput`); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters