Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

couchdb-harness

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

couchdb-harness - npm Package Compare versions

Comparing version 0.0.7 to 0.1.0

.jshintrc

175

index.js

@@ -0,10 +1,94 @@

"use strict";
var spawn = require('child_process').spawn
, fs = require('fs')
, path = require('path')
, glob = require('glob')
, cwd = path.resolve(__dirname)
, uri = path.resolve(cwd, 'server.uri')
, couchjs = path.resolve(cwd, 'bin/couchjs');
var spawn = require('child_process').spawn,
fs = require('fs'),
path = require('path'),
glob = require('glob'),
colors = require('colors/safe'),
which = require('which'),
cwd = path.resolve(__dirname),
uri = path.resolve(cwd, 'server.uri');
var couchjs;
try {
couchjs = which.sync('couchjs');
} catch (err) {
couchjs = path.resolve(cwd, 'bin/couchjs');
}
var blacklist = [
'javascript/tests/attachment_names.js',
'javascript/tests/attachment_ranges.js',
'javascript/tests/attachments.js',
'javascript/tests/attachments_multipart.js',
'javascript/tests/auth_cache.js',
'javascript/tests/batch_save.js',
'javascript/tests/bulk_docs.js',
'javascript/tests/coffee.js',
'javascript/tests/compact.js',
'javascript/tests/config.js',
'javascript/tests/conflicts.js',
'javascript/tests/cookie_auth.js',
'javascript/tests/delayed_commits.js',
'javascript/tests/design_docs.js',
'javascript/tests/design_options.js',
'javascript/tests/erlang_views.js',
'javascript/tests/etags_views.js',
'javascript/tests/form_submit.js',
'javascript/tests/http.js',
'javascript/tests/invalid_docids.js',
'javascript/tests/jsonp.js',
'javascript/tests/list_views.js',
'javascript/tests/method_override.js',
'javascript/tests/oauth.js',
'javascript/tests/oauth_users_db.js',
'javascript/tests/proxyauth.js',
'javascript/tests/purge.js',
'javascript/tests/reader_acl.js',
'javascript/tests/recreate_doc.js',
'javascript/tests/reduce_builtin.js',
'javascript/tests/reduce.js',
'javascript/tests/replication.js',
'javascript/tests/replicator_db_bad_rep_id.js',
'javascript/tests/replicator_db_by_doc_id.js',
'javascript/tests/replicator_db_compact_rep_db.js',
'javascript/tests/replicator_db_continuous.js',
'javascript/tests/replicator_db_credential_delegation.js',
'javascript/tests/replicator_db_field_validation.js',
'javascript/tests/replicator_db_filtered.js',
'javascript/tests/replicator_db_identical_continuous.js',
'javascript/tests/replicator_db_identical.js',
'javascript/tests/replicator_db_invalid_filter.js',
'javascript/tests/replicator_db_security.js',
'javascript/tests/replicator_db_simple.js',
'javascript/tests/replicator_db_successive.js',
'javascript/tests/replicator_db_survives.js',
'javascript/tests/replicator_db_swap_rep_db.js',
'javascript/tests/replicator_db_update_security.js',
'javascript/tests/replicator_db_user_ctx.js',
'javascript/tests/replicator_db_write_auth.js',
'javascript/tests/rev_stemming.js',
'javascript/tests/rewrite.js',
'javascript/tests/security_validation.js',
'javascript/tests/show_documents.js',
'javascript/tests/stats.js',
'javascript/tests/update_documents.js',
'javascript/tests/users_db.js',
'javascript/tests/users_db_security.js',
'javascript/tests/uuids.js',
'javascript/tests/view_collation.js',
'javascript/tests/view_collation_raw.js',
'javascript/tests/view_compaction.js',
'javascript/tests/view_errors.js',
'javascript/tests/view_include_docs.js',
'javascript/tests/view_multi_key_all_docs.js',
'javascript/tests/view_multi_key_design.js',
'javascript/tests/view_multi_key_temp.js',
'javascript/tests/view_offsets.js',
'javascript/tests/view_pagination.js',
'javascript/tests/view_sandboxing.js',
'javascript/tests/view_update_seq.js',
'javascript/tests/view_xml.js'
];
module.exports = {

@@ -16,40 +100,63 @@

// have a linebreak at the end.
var addr = 'http://127.0.0.1:' + (port || 5984) + '/\n'
, files;
var addr = 'http://127.0.0.1:' + (port || 5984) + '/\n';
tests = (!!tests && tests.length)
? tests.map(function (test) {
return 'script/test/' + test + '.js';
})
: glob.sync('script/test/*.js', { cwd: cwd });
if (tests && tests.length) {
tests = tests.map(function (test) {
return 'javascript/tests/' + test + '.js';
});
} else {
tests = glob.sync('javascript/tests/*.js', { cwd: cwd });
}
files = [
'script/json2.js',
'script/sha1.js',
'script/oauth.js',
'script/couch.js',
'script/couch_test_runner.js',
'script/couch_tests.js'
].concat(tests, [
'util/couch_http.js',
'util/cli_runner.js'
]).map(function (fp) {
return path.resolve(cwd, fp);
tests = tests.filter(function(test) {
return blacklist.indexOf(test) === -1;
});
fs.writeFile(uri, addr, { encoding: 'utf8' }, function (err) {
if (err) throw err;
var tests = spawn(couchjs, ['-H', '-u', uri].concat(files));
console.log(colors.cyan('skipping:\n') + blacklist.join('\n') + '\n');
tests.stdout.on('data', function (data) {
process.stdout.write(data);
function runTests(tests, cb, code) {
if (code) {
return cb(code);
}
if (!tests.length) {
return cb(null, 0);
}
var test = tests.shift();
console.log(colors.green("\nStarting " + test));
var files = [
'couchdb-harness-skip.js',
'javascript/json2.js',
'javascript/sha1.js',
'javascript/oauth.js',
'javascript/couch.js',
'javascript/replicator_db_inc.js',
'javascript/couch_test_runner.js',
'javascript/couch_http.js',
'javascript/test_setup.js',
test,
'javascript/cli_runner.js'
].map(function (fp) {
return path.resolve(cwd, fp);
});
var cmd = spawn(couchjs, ['-H', '-u', uri].concat(files));
tests.stderr.on('data', function (data) {
cmd.stdout.on('data', function (data) {
process.stdout.write(colors.grey(data));
});
cmd.stderr.on('data', function (data) {
process.stdout.write(data);
});
tests.on('exit', function (code) {
callback.call(null, code);
cmd.on('exit', function (code) {
runTests(tests, cb, code);
});
}
fs.writeFile(uri, addr, { encoding: 'utf8' }, function (err) {
if (err) {
throw err;
}
runTests(tests, callback);
});

@@ -56,0 +163,0 @@

16

package.json
{
"name": "couchdb-harness",
"version": "0.0.7",
"version": "0.1.0",
"description": "A generalized port of the CouchDB JavaScript test harness.",
"repository": {
"type": "git",
"url": "git://github.com/nick-thompson/couchdb-harness.git"
"url": "git://github.com/pouchdb/couchdb-harness.git"
},
"main": "./index.js",
"scripts": {
"start": "./bin/couchdb-harness"
"start": "./bin/couchdb-harness",
"jshint": "./node_modules/.bin/jshint bin/couchdb-harness index.js",
"test": "npm run jshint"
},
"bin": "./bin/couchdb-harness",
"engines": {

@@ -27,5 +30,10 @@ "node": ">= 0.6.0"

"dependencies": {
"colors": "^1.0.3",
"glob": "~3.1.21",
"optimist": "~0.3.5",
"glob": "~3.1.21"
"which": "^1.0.8"
},
"devDependencies": {
"jshint": "^2.5.11"
}
}

Sorry, the diff of this file is not supported yet

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