14
14
* limitations under the License.
15
15
*/
16
16
17
- /*global describe, it, beforeEach */
18
-
19
17
'use strict' ;
20
18
21
19
var arrify = require ( 'arrify' ) ;
@@ -441,13 +439,17 @@ describe('BigQuery/Dataset', function() {
441
439
ds . setMetadata ( METADATA , assert . ifError ) ;
442
440
} ) ;
443
441
444
- it ( 'should execute callback with error' , function ( done ) {
442
+ it ( 'should execute callback with error & API response ' , function ( done ) {
445
443
var error = new Error ( 'Error.' ) ;
444
+ var apiResponse = { } ;
445
+
446
446
ds . makeReq_ = function ( method , path , query , body , callback ) {
447
- callback ( error ) ;
447
+ callback ( error , apiResponse ) ;
448
448
} ;
449
- ds . setMetadata ( METADATA , function ( err ) {
450
- assert . equal ( err , error ) ;
449
+
450
+ ds . setMetadata ( METADATA , function ( err , apiResponse_ ) {
451
+ assert . strictEqual ( err , error ) ;
452
+ assert . strictEqual ( apiResponse_ , apiResponse ) ;
451
453
done ( ) ;
452
454
} ) ;
453
455
} ) ;
@@ -467,16 +469,8 @@ describe('BigQuery/Dataset', function() {
467
469
} ) ;
468
470
} ) ;
469
471
470
- it ( 'should execute callback with metadata' , function ( done ) {
471
- ds . setMetadata ( METADATA , function ( err , metadata ) {
472
- assert . ifError ( err ) ;
473
- assert . deepEqual ( metadata , METADATA ) ;
474
- done ( ) ;
475
- } ) ;
476
- } ) ;
477
-
478
472
it ( 'should execute callback with apiResponse' , function ( done ) {
479
- ds . setMetadata ( METADATA , function ( err , metadata , apiResponse ) {
473
+ ds . setMetadata ( METADATA , function ( err , apiResponse ) {
480
474
assert . ifError ( err ) ;
481
475
assert . deepEqual ( apiResponse , METADATA ) ;
482
476
done ( ) ;
0 commit comments