@@ -680,6 +680,10 @@ describe('BigQuery/Table', function() {
680680 makeWritableStreamOverride = function ( stream , options ) {
681681 var jobId = options . metadata . jobReference . jobId ;
682682 assert . strictEqual ( jobId , expectedJobId ) ;
683+
684+ var config = options . metadata . configuration . load ;
685+ assert . strictEqual ( config . jobPrefix , undefined ) ;
686+
683687 done ( ) ;
684688 } ;
685689
@@ -1203,7 +1207,7 @@ describe('BigQuery/Table', function() {
12031207 } ) ;
12041208
12051209 it ( 'should not include the schema in the insert request' , function ( done ) {
1206- table . request = function ( reqOpts ) {
1210+ table . request = function ( reqOpts ) {
12071211 assert . strictEqual ( reqOpts . json . schema , undefined ) ;
12081212 assert . strictEqual ( reqOpts . json . autoCreate , undefined ) ;
12091213 done ( ) ;
@@ -1394,7 +1398,16 @@ describe('BigQuery/Table', function() {
13941398 callback ( ) ; // the done fn
13951399 } ;
13961400
1397- table . startCopy ( DEST_TABLE , done ) ;
1401+ table . startCopy ( DEST_TABLE , { } , done ) ;
1402+ } ) ;
1403+
1404+ it ( 'should optionally accept metadata' , function ( done ) {
1405+ table . bigQuery . createJob = function ( reqOpts , callback ) {
1406+ assert . strictEqual ( done , callback ) ;
1407+ callback ( ) ; // the done fn
1408+ } ;
1409+
1410+ table . startCopy ( DEST_TABLE , done ) ;
13981411 } ) ;
13991412 } ) ;
14001413
@@ -1497,20 +1510,16 @@ describe('BigQuery/Table', function() {
14971510 callback ( ) ; // the done fn
14981511 } ;
14991512
1500- table . startCopyFrom ( SOURCE_TABLE , done ) ;
1513+ table . startCopyFrom ( SOURCE_TABLE , { } , done ) ;
15011514 } ) ;
15021515
1503- it ( 'should pass an error to the callback' , function ( done ) {
1504- var error = new Error ( 'Error.' ) ;
1505-
1516+ it ( 'should optionally accept options' , function ( done ) {
15061517 table . bigQuery . createJob = function ( reqOpts , callback ) {
1507- callback ( error ) ;
1518+ assert . strictEqual ( done , callback ) ;
1519+ callback ( ) ; // the done fn
15081520 } ;
15091521
1510- table . startCopyFrom ( SOURCE_TABLE , function ( err ) {
1511- assert . equal ( err , error ) ;
1512- done ( ) ;
1513- } ) ;
1522+ table . startCopyFrom ( SOURCE_TABLE , done ) ;
15141523 } ) ;
15151524 } ) ;
15161525
@@ -1534,7 +1543,7 @@ describe('BigQuery/Table', function() {
15341543 table . bigQuery . createJob = function ( ) { } ;
15351544 } ) ;
15361545
1537- it ( 'should send the correct API request ' , function ( done ) {
1546+ it ( 'should call createJob correctly ' , function ( done ) {
15381547 table . bigQuery . createJob = function ( reqOpts ) {
15391548 assert . deepEqual ( reqOpts . configuration . extract . sourceTable , {
15401549 datasetId : table . dataset . id ,
@@ -1682,6 +1691,15 @@ describe('BigQuery/Table', function() {
16821691 callback ( ) ; // the done fn
16831692 } ;
16841693
1694+ table . startExport ( FILE , { } , done ) ;
1695+ } ) ;
1696+
1697+ it ( 'should optionally accept options' , function ( done ) {
1698+ table . bigQuery . createJob = function ( reqOpts , callback ) {
1699+ assert . strictEqual ( done , callback ) ;
1700+ callback ( ) ; // the done fn
1701+ } ;
1702+
16851703 table . startExport ( FILE , done ) ;
16861704 } ) ;
16871705 } ) ;
@@ -1838,6 +1856,15 @@ describe('BigQuery/Table', function() {
18381856 callback ( ) ; // the done fn
18391857 } ;
18401858
1859+ table . startImport ( FILE , { } , done ) ;
1860+ } ) ;
1861+
1862+ it ( 'should optionally accept options' , function ( done ) {
1863+ table . bigQuery . createJob = function ( reqOpts , callback ) {
1864+ assert . strictEqual ( done , callback ) ;
1865+ callback ( ) ; // the done fn
1866+ } ;
1867+
18411868 table . startImport ( FILE , done ) ;
18421869 } ) ;
18431870
0 commit comments