update rest of parsers to allow property to be selected

This commit is contained in:
Dave Conway-Jones
2018-01-31 11:18:30 +00:00
parent f664fa0e31
commit b2de928860
10 changed files with 158 additions and 139 deletions

View File

@@ -1,3 +1,18 @@
/**
* Copyright 2015 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
var should = require("should");
var helper = require('../../../test/helper.js');
@@ -129,7 +144,7 @@ describe('geohash node', function() {
});
it('should convert location lat, lon to geohash', function(done) {
var flow = [{"id":"n1", "type":"geohash", func:"geohash", gap:0, wires:[["n2"]] },
var flow = [{id:"n1", type:"geohash", func:"geohash", property:"location", gap:0, wires:[["n2"]] },
{id:"n2", type:"helper"} ];
helper.load(testNode, flow, function() {
var n1 = helper.getNode("n1");
@@ -144,7 +159,7 @@ describe('geohash node', function() {
});
it('should convert location lat, lon to geohash (low precision)', function(done) {
var flow = [{"id":"n1", "type":"geohash", func:"geohash", gap:0, wires:[["n2"]] },
var flow = [{"id":"n1", "type":"geohash", func:"geohash", property:"location", gap:0, wires:[["n2"]] },
{id:"n2", type:"helper"} ];
helper.load(testNode, flow, function() {
var n1 = helper.getNode("n1");
@@ -159,7 +174,7 @@ describe('geohash node', function() {
});
it('should convert location geohash to lat.lon', function(done) {
var flow = [{"id":"n1", "type":"geohash", func:"geohash", gap:0, wires:[["n2"]] },
var flow = [{"id":"n1", "type":"geohash", func:"geohash", property:"location", gap:0, wires:[["n2"]] },
{id:"n2", type:"helper"} ];
helper.load(testNode, flow, function() {
var n1 = helper.getNode("n1");
@@ -289,7 +304,7 @@ describe('geohash node', function() {
});
it('should warn if location object with only a lat (or lon)', function(done) {
var flow = [{"id":"n1", "type":"geohash", func:"gap", gap:10, wires:[["n2"]] },
var flow = [{"id":"n1", "type":"geohash", func:"gap", property:"location", gap:10, wires:[["n2"]] },
{id:"n2", type:"helper"} ];
helper.load(testNode, flow, function() {
var n1 = helper.getNode("n1");