'use strict';
var reverse = require('./../index.js'),
    chai = require('chai'),
    expect = chai.expect;
describe(".location()", function () {
    it("{arguments} number invalid should throw error.", function () {
        expect(reverse.location).to.throw(Error);
    });
    it('{latitude} or {longitude} undefined should throw error.', function () {
        expect(function () {
            reverse.location({}, function () {});
        }).to.throw(Error);
    });
    it('valid gps should return location.', function (done) {
        reverse.location({
            'latitude': 40.00403611111111,
            'longitude': 116.48485555555555
        }, function (err, data) {
            data && done(); //
        });
    });
    it('custom options should be valid.', function (done) {
        reverse.location({
            'latitude': 40.00403611111111,
            'longitude': 116.48485555555555,
            'language': 'zh-cn'
        }, function (err, data) {
            data && done();
        });
    });
    //because baidu maps need private token, so... pass the test;)
});

@@ -101,16 +101,275 @@
 expect;%0A
+%0Avar maps = %7B%0A  'google': %7B%7D%0A%7D;%0A%0Aif(process.env%5B'BAIDU_KEY'%5D) %7B%0A  maps%5B'baidu'%5D = %7B 'ak': process.env%5B'BAIDU_KEY'%5D %7D;%0A%7D%0A%0AObject.keys(maps).forEach(function (map) %7B%0A    var options = maps%5Bmap%5D;%0A    options%5B'map'%5D = map;%0A%0A    describe(map, function() %7B%0A        
 describe
@@ -394,24 +394,32 @@
 nction () %7B%0A
+        
     it(%22%7Barg
@@ -481,24 +481,32 @@
 ) %7B%0A        
+       
+ 
 expect(rever
@@ -531,36 +531,52 @@
 row(Error);%0A    
-%7D);%0A
+        %7D);%0A        
     it('%7Blatitud
@@ -643,24 +643,32 @@
 ) %7B%0A        
+ 
+       
 expect(funct
@@ -680,32 +680,40 @@
 ) %7B%0A            
+   
+     
 reverse.location
@@ -713,18 +713,23 @@
 ocation(
-%7B%7D
+options
 , functi
@@ -747,16 +747,24 @@
         
+    
+    
 %7D).to.th
@@ -775,28 +775,44 @@
 Error);%0A    
-%7D);%0A
+        %7D);%0A        
     it('vali
@@ -853,32 +853,40 @@
 nction (done) %7B%0A
+        
         reverse.
@@ -886,34 +886,69 @@
 everse.location(
-%7B%0A
+Object.assign(%7B%7D, options, %7B%0A        
             'lat
@@ -978,32 +978,40 @@
 11,%0A            
+ 
+       
 'longitude': 116
@@ -1026,33 +1026,42 @@
 5555555%0A        
+  
-%7D
+      %7D)
 , function (err,
@@ -1073,32 +1073,40 @@
 ) %7B%0A            
+  
+      
 data && done(); 
@@ -1112,36 +1112,60 @@
  //%0A        
-%7D);%0A    %7D);%0A
+        %7D);%0A            %7D);%0A        
     it('cust
@@ -1212,32 +1212,40 @@
 done) %7B%0A        
+      
+  
 reverse.location
@@ -1245,18 +1245,53 @@
 ocation(
-%7B%0A
+Object.assign(%7B%7D, options, %7B%0A        
         
@@ -1329,32 +1329,40 @@
 11,%0A            
+        
 'longitude': 116
@@ -1390,16 +1390,24 @@
         
+        
 'languag
@@ -1426,17 +1426,26 @@
         
+  
-%7D
+      %7D)
 , functi
@@ -1465,32 +1465,40 @@
 ) %7B%0A            
+        
 data && done();%0A
@@ -1505,24 +1505,32 @@
         
+   
+     
 %7D);%0A    
 %7D);%0A    
@@ -1525,78 +1525,39 @@
     
-%7D);%0A    //because baidu maps need private token, so... pass the test;)
+        %7D);%0A        %7D);%0A    %7D);
 %0A%7D);

Allow testing Baidu by setting BAIDU_KEY environment variable