Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* global describe, beforeEach, afterEach, it, emit */
/**
* Unit tests for couchdb-model
*/
var should = require('chai').should();
var couchDBModel = require('../lib/couchdb-model.js');
var createNano = require('nano');
var extend = require('node.extend');
var Q = require('q');
var httpMocks = require('node-mocks-http');
Q.longStackSupport = true;
var COUCHDB_BASE_URL = process.env.COUCHDB_BASE_URL;
if (!COUCHDB_BASE_URL) {
throw new Error(
'$COUCHDB_BASE_URL environment variable is not set. ' +
'Please provide a working couchdb base URL to run the tests.');
}
var COUCHDB_DB_NAME = process.env.COUCHDB_DB_NAME || 'couchdb-model-test';
var nano = createNano(COUCHDB_BASE_URL);
describe('couchdb-model REST API', function() {
beforeEach(function(done) {
nano.db.destroy(COUCHDB_DB_NAME, function() {
nano.db.create(COUCHDB_DB_NAME, function(error) {
/* global describe, beforeEach, afterEach, it */
'use strict';
var fire = require('..');
var assert = require('assert');
var crypto = require('crypto');
var uuid = require('node-uuid');
var Q = require('q');
Q.longStackSupport = true;
describe('model methods', function() {
var models;
var app = null;
beforeEach(function(done) {
app = fire.app('methods', {});
fire.start()
.then(function() {
models = app.models;
done();
})
.done();
});
// -*- mode: js; indent-tabs-mode: nil; js-basic-offset: 4 -*-
//
// This file is part of ThingEngine
//
// Copyright 2016 The Board of Trustees of the Leland Stanford Junior University
//
// Author: Giovanni Campagna
//
// See COPYING for details
"use strict";
const Q = require('q');
Q.longStackSupport = true;
process.on('unhandledRejection', (up) => { throw up; });
const assert = require('assert');
const ThingTalk = require('thingtalk');
const Ast = ThingTalk.Ast;
const Utils = require('thingtalk/lib/utils');
const Engine = require('../lib/engine');
const ExecWrapper = require('../lib/apps/exec_wrapper');
function* timerTest(__builtin,env) {
"use strict";
let _t_0;
let _t_1;
let _t_2;
var ReadFileCache = require("./cache").ReadFileCache;
var Watcher = require("./watcher").Watcher;
var contextModule = require("./context");
var BuildContext = contextModule.BuildContext;
var PreferredFileExtension = contextModule.PreferredFileExtension;
var ModuleReader = require("./reader").ModuleReader;
var output = require("./output");
var DirOutput = output.DirOutput;
var StdOutput = output.StdOutput;
var util = require("./util");
var log = util.log;
var Ap = Array.prototype;
var each = Ap.forEach;
// Better stack traces for promises.
Q.longStackSupport = true;
function Commoner() {
var self = this;
assert.ok(self instanceof Commoner);
Object.defineProperties(self, {
customVersion: { value: null, writable: true },
customOptions: { value: [] },
resolvers: { value: [] },
processors: { value: [] }
});
}
var Cp = Commoner.prototype;
Cp.version = function(version) {
var ArgumentParser = require('argparse').ArgumentParser;
var assert = require('assert');
var bitgo = require('bitgo');
var bitcoin = bitgo.bitcoin;
var ini = require('ini');
var rpc = require('json-rpc2');
var Q = require('q');
var fs = require('fs');
var _ = require('lodash');
var winston = require('winston');
_.string = require('underscore.string');
var pjson = require('../package.json');
var BITGOD_VERSION = pjson.version;
Q.longStackSupport = true;
var BitGoD = function () {
this.loggingEnabled = true;
// Set up logger
var logLevels = {
debug: 2,
info: 1,
error: 0
};
var logColors = {
debug: 'grey',
info: 'blue',
error: 'red',
fatal: 'magenta'
describe('fs-path', function(){
var Q = require('q');
Q.longStackSupport = true;
var FileSystem = require('../src/FileSystem.js');
var FilePath = require('../src/FilePath.js');
var fs = require('../src/index.js');
var is = require('nor-is');
var assert = require('assert');
it('should be an instance of FileSystem', function(){
assert.strictEqual(true, is.objOf(fs, FileSystem));
});
describe('.FileSystem', function(){
it('should be same as FileSystem', function(){
assert.strictEqual(fs.FileSystem, FileSystem);
});
});
"use strict";
const Q = require('q');
Q.longStackSupport = true;
const CVC4Solver = require('smtlib').LocalCVC4Solver;
const Ast = require('../lib/ast');
const Grammar = require('../lib/grammar_api');
const Compiler = require('../lib/compiler');
const SchemaRetriever = require('../lib/schema');
const PermissionChecker = require('../lib/permission_checker');
const _mockSchemaDelegate = require('./mock_schema_delegate');
const schemaRetriever = new SchemaRetriever(_mockSchemaDelegate, null, true);
const TEST_CASES = [
[`now => @com.facebook.post(status="this is really funny lol");`,
true, { transform: false }],
[`now => @com.facebook.post(status="this is sad");`,
false, { transform: false }],
#!/usr/bin/env node
var q = require('q')
q.longStackSupport = true
const debug = require('debug')('next-update')
var nextUpdate = require('../src/next-update')
var program = require('../src/cli-options')
var join = require('path').join
var parentFolder = join(__dirname, '..')
var pkg = require(join(parentFolder, 'package.json'))
var info =
pkg.name +
'@' +
pkg.version +
'\n' +
' - ' +
pkg.description +
'\n' +
#!/usr/bin/env node
require('newrelic');
require('babel-polyfill');
require('babel-register');
require('q').longStackSupport = true;
require('./up-to-code');
var perf = module.exports = function(args, done) {
var errs = 0;
var lastErr;
var times = args.n;
global.asyncTime = args.t;
global.parallelQueries = args.p || 10;
if (args.longStackSupport) {
global.longStackSupport = require('q').longStackSupport
= args.longStackSupport;
require('bluebird').longStackTraces();
}
var fn = require(args.file);
var start = Date.now();
var warmedUp = 0;
var tot = Math.min( 350, times );
for (var k = 0, kn = tot; k < kn; ++k)
fn(k,'b','c', warmup);
var memMax; var memStart; var start;
function warmup() {