@@ -6,7 +6,7 @@ import { QueueClient } from '@azure/storage-queue';
6
6
import { expect } from 'chai' ;
7
7
import { default as fetch } from 'node-fetch' ;
8
8
import { getFuncUrl } from './constants' ;
9
- import { waitForOutput } from './global.test' ;
9
+ import { model , waitForOutput } from './global.test' ;
10
10
import { storageConnectionString } from './resources/connectionStrings' ;
11
11
import { getRandomTestData } from './utils/getRandomTestData' ;
12
12
@@ -83,4 +83,25 @@ describe('storage', () => {
83
83
expect ( result ) . to . deep . equal ( items ) ;
84
84
await waitForOutput ( `httpTriggerTableInput was triggered` ) ;
85
85
} ) ;
86
+
87
+ // Test for bug https://github.com/Azure/azure-functions-nodejs-library/issues/179
88
+ it ( 'Shared output bug' , async function ( this : Mocha . Context ) {
89
+ if ( model === 'v3' ) {
90
+ this . skip ( ) ;
91
+ }
92
+
93
+ const containerName = 'e2e-test-container' ;
94
+ const client = new ContainerClient ( storageConnectionString , containerName ) ;
95
+ await client . createIfNotExists ( ) ;
96
+
97
+ const message = getRandomTestData ( ) ;
98
+ const messageBuffer = Buffer . from ( message ) ;
99
+ const blobName = 'e2e-test-blob-trigger-shared-output-bug' ;
100
+ await client . uploadBlockBlob ( blobName , messageBuffer , messageBuffer . byteLength ) ;
101
+
102
+ await waitForOutput ( `storageBlobTriggerReturnOutput was triggered` ) ;
103
+ await waitForOutput ( `storageBlobTriggerExtraOutput was triggered` ) ;
104
+ await waitForOutput ( `storageQueueTrigger was triggered by "${ message } -returnOutput"` ) ;
105
+ await waitForOutput ( `storageQueueTrigger was triggered by "${ message } -extraOutput"` ) ;
106
+ } ) ;
86
107
} ) ;
0 commit comments