@@ -38,16 +38,16 @@ describe('logging-bunyan', function() {
3838 } ;
3939 }
4040
41- function fakeWritable ( options ) {
41+ function FakeWritable ( options ) {
4242 fakeWritableOptions_ = options ;
4343 }
4444
45- fakeWritable . prototype . write = function ( chunk , encoding , callback ) {
45+ FakeWritable . prototype . write = function ( chunk , encoding , callback ) {
4646 setImmediate ( callback ) ;
4747 } ;
4848
4949 var fakeStream = {
50- Writable : fakeWritable
50+ Writable : FakeWritable
5151 } ;
5252
5353 var LoggingBunyanCached ;
@@ -90,7 +90,7 @@ describe('logging-bunyan', function() {
9090 } ) ;
9191
9292 it ( 'should be an object mode Writable' , function ( ) {
93- assert ( loggingBunyan instanceof fakeWritable ) ;
93+ assert ( loggingBunyan instanceof FakeWritable ) ;
9494 assert . deepStrictEqual ( fakeWritableOptions_ , { objectMode : true } ) ;
9595 } ) ;
9696
@@ -126,11 +126,11 @@ describe('logging-bunyan', function() {
126126 } ) ;
127127 } ) ;
128128
129- describe ( '_formatEntry ' , function ( ) {
129+ describe ( 'formatEntry_ ' , function ( ) {
130130
131131 it ( 'should throw an error if record is a string' , function ( ) {
132132 assert . throws ( function ( ) {
133- loggingBunyan . _formatEntry ( 'string record' ) ;
133+ loggingBunyan . formatEntry_ ( 'string record' ) ;
134134 } , new RegExp (
135135 '@google-cloud/logging-bunyan only works as a raw bunyan stream type.'
136136 ) ) ;
@@ -146,7 +146,7 @@ describe('logging-bunyan', function() {
146146 done ( ) ;
147147 } ;
148148
149- loggingBunyan . _formatEntry ( RECORD ) ;
149+ loggingBunyan . formatEntry_ ( RECORD ) ;
150150 } ) ;
151151
152152 it ( 'should rename the msg property to message' , function ( done ) {
@@ -158,7 +158,7 @@ describe('logging-bunyan', function() {
158158 done ( ) ;
159159 } ;
160160
161- loggingBunyan . _formatEntry ( recordWithMsg ) ;
161+ loggingBunyan . formatEntry_ ( recordWithMsg ) ;
162162 } ) ;
163163
164164 it ( 'should inject the error stack as the message' , function ( done ) {
@@ -181,7 +181,7 @@ describe('logging-bunyan', function() {
181181 done ( ) ;
182182 } ;
183183
184- loggingBunyan . _formatEntry ( record ) ;
184+ loggingBunyan . formatEntry_ ( record ) ;
185185 } ) ;
186186
187187 it ( 'should leave message property intact when present' , function ( done ) {
@@ -198,7 +198,7 @@ describe('logging-bunyan', function() {
198198 done ( ) ;
199199 } ;
200200
201- loggingBunyan . _formatEntry ( record ) ;
201+ loggingBunyan . formatEntry_ ( record ) ;
202202 } ) ;
203203 } ) ;
204204
@@ -211,7 +211,7 @@ describe('logging-bunyan', function() {
211211 } ) ;
212212
213213 it ( 'should format the record' , function ( done ) {
214- loggingBunyan . _formatEntry = function ( record ) {
214+ loggingBunyan . formatEntry_ = function ( record ) {
215215 assert . strictEqual ( record , RECORD ) ;
216216 done ( ) ;
217217 } ;
@@ -229,16 +229,15 @@ describe('logging-bunyan', function() {
229229
230230 LoggingBunyan . BUNYAN_TO_STACKDRIVER [ RECORD . level ] = customLevel ;
231231
232- loggingBunyan . log_ [ customLevel ] = function ( entry_ ) {
232+ loggingBunyan . log_ [ customLevel ] = function ( entry_ , callback ) {
233233 assert . strictEqual ( entry_ , entry ) ;
234- done ( ) ;
234+ callback ( ) ; // done()
235235 } ;
236236
237- loggingBunyan . _write ( RECORD , '' , assert . ifError ) ;
237+ loggingBunyan . _write ( RECORD , '' , done ) ;
238238 } ) ;
239239 } ) ;
240240
241-
242241 describe ( 'BUNYAN_TO_STACKDRIVER' , function ( ) {
243242 it ( 'should correctly map to Stackdriver Logging levels' , function ( ) {
244243 assert . deepEqual ( LoggingBunyan . BUNYAN_TO_STACKDRIVER , {
0 commit comments