Permalink
Browse files

remove vows completely

- rewrite the timezone integration test
  • Loading branch information...
1 parent 3742793 commit acf0f740ace7afaab07468d217ef6eaa266b02f8 @fabriziomoscon fabriziomoscon committed Jul 19, 2016
Showing with 48 additions and 22 deletions.
  1. +1 −1 package.json
  2. +47 −21 test/integration/timezone-test.js
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "googlemaps",
- "version": "1.11.0",
+ "version": "1.11.1",
"main": "lib/index",
"description": "A simple way to query the Google Maps API from Node.js",
"license": "MIT",
View
68 test/integration/timezone-test.js
@@ -1,23 +1,49 @@
-var vows = require('vows'),
- assert = require('assert'),
- GoogleMapsAPI = require('../../lib/index')
- config = require('../simpleConfig');
+var GoogleMapsAPI = require('../../lib/index');
+var config = require('../simpleConfig');
+var should = require('should');
+describe('timezone', function() {
-vows.describe('timezone').addBatch({
- 'Simple timezone request': {
- topic: function(){
- var gm = new GoogleMapsAPI(config);
- gm.timezone({
- location: '-33.86,151.20',
- timestamp: 1234567890
- }, this.callback);
- },
- 'returns as a valid request': function(err, result){
- assert.equal(result.status , 'OK');
- },
- 'returns the expected timezone Id for location': function(err, result){
- assert.equal(result.timeZoneId, 'Australia/Sydney');
- }
- }
-}).export(module);
+ var gm = new GoogleMapsAPI(config);
+
+ var params = {
+ location: '-33.86,151.20',
+ timestamp: 1234567890
+ };
+
+ it('should return a valid response', function(done) {
+ gm.timezone(params, function(err, result) {
+ should.not.exist(err);
+ should.exist(result);
+ result.status.should.equal('OK');
+ done();
+ });
+ });
+
+ // Google response
+ // {
+ // dstOffset: 3600,
+ // rawOffset: 36000,
+ // status: 'OK',
+ // timeZoneId: 'Australia/Sydney',
+ // timeZoneName: 'Australian Eastern Daylight Time'
+ // }
+ it('should return the expected timezone', function(done) {
+ gm.timezone(params, function(err, result) {
+ should.not.exist(err);
+ should.exist(result);
+ should.exist(result.dstOffset);
+ should.exist(result.rawOffset);
+ should.exist(result.timeZoneId);
+ should.exist(result.timeZoneName);
+ result.timeZoneId.should.equal('Australia/Sydney');
+ result.timeZoneName.should.equal('Australian Eastern Daylight Time');
+ result.rawOffset.should.equal(36000);
+ result.dstOffset.should.equal(3600);
+ done();
+ });
+ });
+
+ // TODO we should add more tests for edge cases Timezones
+
+});

0 comments on commit acf0f74

Please sign in to comment.