Skip to content

Commit 87898a8

Browse files
committed
Fixing test failure
1 parent 4e70391 commit 87898a8

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

test/WebJobs.Script.Tests.Integration/TestScripts/Node/functions.tests.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,7 @@ describe('functions', () => {
155155
_inputs: [],
156156
bindings: {},
157157
log: (message) => logs.push(message),
158-
_metric: (metric) => metrics.push(metric),
159-
bind: (val, cb) => {
160-
bindingValues = val;
161-
cb && cb(val);
162-
}
158+
_metric: (metric) => metrics.push(metric)
163159
};
164160
});
165161

@@ -295,14 +291,16 @@ describe('functions', () => {
295291
});
296292
});
297293

298-
it('done passes data to binder', () => {
294+
it('binding values propagate correctly', () => {
299295
var func = functions.createFunction((context) => {
300-
context.bindings = { result: 'res' };
296+
context.bindings = { foo: 'abc', bar: 123 };
301297
context.done();
302298
});
303299

304-
func(context, (results) => {
305-
expect(results).to.eql({ result: 'res' });
300+
func(context, (err, result) => {
301+
expect(Object.keys(result).length).to.equal(2);
302+
expect(result.returnValue).to.equal(undefined);
303+
expect(result.bindingValues).to.eql({ foo: 'abc', bar: 123 });
306304
});
307305
});
308306

@@ -311,8 +309,8 @@ describe('functions', () => {
311309
context.done('err');
312310
});
313311

314-
func(context, (results) => {
315-
expect(results).to.eql('err');
312+
func(context, (err, result) => {
313+
expect(err).to.eql('err');
316314
});
317315
});
318316

@@ -321,8 +319,8 @@ describe('functions', () => {
321319
return Promise.reject('err');
322320
});
323321

324-
func(context, (results) => {
325-
expect(results).to.eql('err');
322+
func(context, (err, result) => {
323+
expect(err).to.eql('err');
326324
done();
327325
});
328326
});
@@ -338,7 +336,7 @@ describe('functions', () => {
338336
context.req = {
339337
headers: { 'field': 'val' }
340338
};
341-
func(context, (results) => {
339+
func(context, (err, result) => {
342340
expect(context.res.statusCode).to.equal(200);
343341
expect(context.res.body).to.equal('test');
344342
expect(context.res.headers.header).to.equal('val');

0 commit comments

Comments
 (0)