climate-data-crawler
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -23,3 +23,3 @@ "use strict"; | ||
var queryNext = function(){ | ||
if (index < locations.length && index < count) { | ||
if (index < (locations.length - offset) && index < count) { | ||
var queryLocation = locations[index + offset]; | ||
@@ -26,0 +26,0 @@ queryLocationId = queryLocation.id; |
{ | ||
"name": "climate-data-crawler", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Data Crawler for CDO (Climate Data Online) web services", | ||
@@ -5,0 +5,0 @@ "main": "app.js", |
@@ -343,2 +343,34 @@ "use strict"; | ||
it('should not go out of bounds on locations', function(){ | ||
// arrange | ||
offset = 2; | ||
count = 3; | ||
locations = [ | ||
{ | ||
"id": "CITY:NL000001", | ||
"maxdate": "2015-01-31" | ||
}, | ||
{ | ||
"id": "CITY:RS000001", | ||
"maxdate": "2015-03-04" | ||
}, | ||
{ | ||
"id": "CITY:CD000001", | ||
"maxdate": "1978-12-31" | ||
} | ||
]; | ||
var crawler = getInstance(); | ||
// act | ||
crawler.run(); | ||
// assert | ||
assert.doesNotThrow(function(){ | ||
for (var i = 0; i < locations.length; i++){ | ||
simulateQueryCompleted(null) | ||
} | ||
}); | ||
}); | ||
}); | ||
@@ -345,0 +377,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58133
1539