New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pelias-fuzzy-tester

Package Overview
Dependencies
Maintainers
5
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pelias-fuzzy-tester - npm Package Compare versions

Comparing version 1.6.0 to 1.7.0

7

lib/validate_test_suites.js

@@ -5,2 +5,6 @@ var util = require( 'util' );

function setEndpoint(testCase, testSuite) {
testCase.endpoint = testCase.endpoint || testSuite.endpoint || 'search';
}
function validateTestSuite(testSuite) {

@@ -15,2 +19,5 @@ return testSuite.tests.map( function ( testCase ){

// ensure endpoint is set for later use
setEndpoint(testCase, testSuite);
if( 'unexpected' in testCase ){

@@ -17,0 +24,0 @@ testCase.unexpected.properties.forEach( function ( props ){

33

output_generators/terminal.js

@@ -11,2 +11,3 @@ /**

var util = require( 'util' );
const url = require('url');

@@ -16,2 +17,29 @@ var percentageForDisplay = require('../lib/percentageForDisplay');

function inputToUrl(testCase) {
const path = `/v1/${testCase.endpoint}`;
const paramStrings = [];
const priorityParams = ['point.lat', 'point.lon', 'text'];
Object.keys(testCase.in).forEach(function(key) {
// skip keys already in the priority list
if (priorityParams.includes(key)) {
return;
} else {
paramStrings.push(`${key}=${testCase.in[key]}`);
}
});
// ensure priority params are last
priorityParams.forEach(function (priorityParam) {
if (testCase.in[priorityParam]) {
paramStrings.push(`${priorityParam}=${testCase.in[priorityParam]}`);
}
});
return `${path}?${paramStrings.join('&')}`;
}
/**

@@ -25,3 +53,4 @@ * Format and print a test result to the terminal.

var input = JSON.stringify(result.testCase.in);
const query = inputToUrl(testCase);
var expectationCount;

@@ -36,3 +65,3 @@

var expectationString = (expectationCount > 1) ? ' (' + expectationCount + ' expectations)' : '';
var testDescription = input + expectationString;
var testDescription = query + expectationString;

@@ -39,0 +68,0 @@ var status = (result.progress === undefined) ? '' : result.progress.inverse + ' ';

2

package.json
{
"name": "pelias-fuzzy-tester",
"version": "1.6.0",
"version": "1.7.0",
"description": "A testing suite by Mapzen with fuzzy testing ability",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc