File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 16
16
'use strict' ;
17
17
18
18
// [START functions_log_helloworld]
19
- exports . helloWorld = ( event , callback ) => {
19
+ exports . helloWorld = ( req , res ) => {
20
20
console . log ( 'I am a log entry!' ) ;
21
21
console . error ( 'I am an error!' ) ;
22
- callback ( ) ;
22
+ res . end ( ) ;
23
23
} ;
24
24
// [END functions_log_helloworld]
25
25
Original file line number Diff line number Diff line change @@ -57,14 +57,14 @@ test.afterEach.always(tools.restoreConsole);
57
57
58
58
test . serial ( `should write to log` , ( t ) => {
59
59
const expectedMsg = `I am a log entry!` ;
60
- const callback = sinon . stub ( ) ;
60
+ const res = { end : sinon . stub ( ) } ;
61
61
62
- getSample ( ) . program . helloWorld ( { } , callback ) ;
62
+ getSample ( ) . program . helloWorld ( { } , res ) ;
63
63
64
64
t . is ( console . log . callCount , 1 ) ;
65
65
t . deepEqual ( console . log . firstCall . args , [ expectedMsg ] ) ;
66
- t . is ( callback . callCount , 1 ) ;
67
- t . deepEqual ( callback . firstCall . args , [ ] ) ;
66
+ t . is ( res . end . callCount , 1 ) ;
67
+ t . deepEqual ( res . end . firstCall . args , [ ] ) ;
68
68
} ) ;
69
69
70
70
test . serial ( `getLogEntries: should retrieve logs` , ( t ) => {
You can’t perform that action at this time.
0 commit comments