Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const generateQuery = require('../../../query/address_search_using_ids');
const _ = require('lodash');
const proxyquire = require('proxyquire').noCallThru();
const mock_logger = require('pelias-mock-logger');
const MockQuery = require('./MockQuery');
module.exports.tests = {};
module.exports.tests.interface = (test, common) => {
test('valid interface', (t) => {
t.ok(_.isFunction(generateQuery));
t.end();
});
};
// helper for canned views
const views = {
focus_only_function: () => 'focus_only_function',
boundary_country: 'boundary_country view',
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const assert = require("chai").assert,
path = require("path"),
sinon = require("sinon"),
leche = require("leche"),
shell = require("shelljs"),
Config = require("../../lib/config"),
fs = require("fs"),
os = require("os"),
hash = require("../../lib/util/hash");
const proxyquire = require("proxyquire").noCallThru().noPreserveCache();
//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------
describe("CLIEngine", () => {
const examplePluginName = "eslint-plugin-example",
examplePluginNameWithNamespace = "@eslint/eslint-plugin-example",
requireStubs = {},
examplePlugin = {
rules: {
"example-rule": require("../fixtures/rules/custom-rule"),
"make-syntax-error": require("../fixtures/rules/make-syntax-error-rule")
}
},
var test = require('tape');
var proxyquire = require('proxyquire');
var sinon = require('sinon');
// proxyquired connection module
var Connection = proxyquire.noCallThru().load('../lib/connection',
{ serialport: {
list: function() { return Promise.resolve(
[
{ comName: '/dev/cu.sierravsp', manufacturer: '', serialNumber: '',
pnpId: '', locationId: '', vendorId: '', productId: '' },
{ comName: '/dev/cu.Bluetooth-Incoming-Port', manufacturer: '',
serialNumber: '', pnpId: '', locationId: '', vendorId: '',
productId: '' },
{ comName: '/dev/cu.usbmodem1421', manufacturer: 'Arduino (www.arduino.cc)',
serialNumber: '55432333038351F03170', pnpId: '', locationId: '0x14200000',
vendorId: '0x2341', productId: '0x0043' }
])
}
},
SerialPort: require('./helpers/mockSerial').SerialPort
const assert = require('assert');
const sinon = require('sinon');
const proxyquire = require('proxyquire').noCallThru();
const config = {
l10n_dev: false // prod configuration
};
const pkg = {
availableLanguages: ['en-US', 'fr', 'it', 'es-ES']
};
function request(acceptLang) {
return {
headers: {
'accept-language': acceptLang
}
};
}
const test = require('ava')
const proxyquire = require('proxyquire').noCallThru()
const { gatewayHttpUrl } = require('../src/url-utils')
test('get http gateway url for a cid', t => {
const expected = 'https://ipfs.io/ipfs/fakecid/'
const actual = gatewayHttpUrl('fakecid')
t.is(actual, expected)
})
test('get http gateway url for a cid on infura', t => {
const expected = 'https://ipfs.infura.io/ipfs/fakecid/'
const actual = gatewayHttpUrl('fakecid', 'infura')
t.is(actual, expected)
})
test('get http gateway url for a cid on pinata', t => {
const expected = 'https://gateway.pinata.cloud/ipfs/fakecid/'
'use strict';
var should = require('should');
var bluebird = require('bluebird');
var proxyquire = require('proxyquire').noCallThru();
var util = require('util');
var ErrorsMock = {
BaseError: function () {},
InvalidQueryResultError: function () {},
EmptyQueryQueueError: function () {},
};
util.inherits(ErrorsMock.BaseError, Error);
util.inherits(ErrorsMock.InvalidQueryResultError, Error);
util.inherits(ErrorsMock.EmptyQueryQueueError, Error);
var QueryInterface = proxyquire('../src/queryinterface', {
'./errors': ErrorsMock,
});
describe('QueryInterface', function () {
const sinon = require('sinon');
const proxyquire = require('proxyquire').noCallThru();
const storage = {
ttl: sinon.stub()
};
function request(id, meta) {
return {
params: { id },
meta
};
}
function response() {
return {
sendStatus: sinon.stub(),
send: sinon.stub()
'use strict'
const chai = require('chai')
const expect = chai.expect
const sinon = require('sinon')
const proxyquire = require('proxyquire').noCallThru()
chai.use(require('sinon-chai'))
describe('mocker: rtm', function () {
let rtm
let wsMock
let wsServerMock
let wsClientMock
let expressMock
let expressAppMock
let serverMock
let loggerMock
before(function () {
wsClientMock = {
send: sinon.stub(),
const assert = require('assert');
const proxyquire = require('proxyquire').noCallThru();
const sinon = require('sinon');
describe('ServiceClient', () => {
let clientOptions;
const requestStub = sinon.stub();
const emptySuccessResponse = Promise.resolve({
statusCode: 200,
headers: {},
body: '{}'
});
const ServiceClient = proxyquire('../lib/client', {
'./request': requestStub
});
'use strict';
const proxyquire = require('proxyquire').noCallThru();
describe('user actions service', () => {
let sut;
let challengeModel;
let challengeIds;
let user;
let saveResult;
beforeEach(() => {
challengeIds = ['id#1'];
saveResult = 'something has been saved... or not';
challengeModel = {
find: env.stub().returns(challengeModel),
populate: env.stub().returns(challengeIds)
};
user = {