couchdb-harness
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "couchdb-harness", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A generalized port of the CouchDB JavaScript test harness.", | ||
@@ -9,2 +9,3 @@ "repository": { | ||
}, | ||
"main": "./index.js", | ||
"scripts": { | ||
@@ -11,0 +12,0 @@ "start": "./bin/couchdb-harness" |
@@ -5,2 +5,34 @@ # CouchDB Harness | ||
## Install | ||
``` | ||
npm install couchdb-harness | ||
``` | ||
## Usage | ||
### Command Line | ||
To run the default configuration, you can simply type, | ||
``` | ||
$ npm start | ||
``` | ||
But the binary also accepts arguments to specify the port that the harness | ||
should run against, as well as which files to test, | ||
``` | ||
./bin/couchdb-harness -p 5984 basics all_docs | ||
``` | ||
### Node.js | ||
``` | ||
var harness = require('couchdb-harness'); | ||
harness.run(5984, ['basics', 'all_docs'], function (exitCode) { | ||
process.exit(exitCode); | ||
}); | ||
``` | ||
## License | ||
@@ -7,0 +39,0 @@ |
@@ -16,5 +16,4 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
var result = JSON.parse(CouchDB.request("GET", "/").responseText); | ||
// TODO: This hardly checks anything... over generalized. | ||
T(typeof result === "object"); | ||
T(!!result.version); | ||
@@ -49,7 +48,4 @@ var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"}); | ||
// Get the database info, check the db_name | ||
T(db.info().db_name == "test_suite_db"); | ||
// TODO: This fails against pouchdb-server because PouchDB's info method | ||
// returns a field `name`. | ||
// T(db.info().db_name == "test_suite_db"); | ||
T(CouchDB.allDbs().some(function (db) { | ||
@@ -133,6 +129,4 @@ return /test_suite_db/.test(db); | ||
// TODO: This fails against pouchdb-server because PouchDB's query api | ||
// doesn't return a `total_rows` property on the result object. | ||
// verify only one document found and the result value (doc.b). | ||
// T(results.total_rows == 1 && results.rows[0].value == 16); | ||
T(results.total_rows == 1 && results.rows[0].value == 16); | ||
@@ -151,5 +145,4 @@ // reopen document we saved earlier | ||
// TODO: See previous todo. | ||
// the modified document should now be in the results. | ||
// T(results.total_rows == 2); | ||
T(results.total_rows == 2); | ||
@@ -163,4 +156,3 @@ // write 2 more documents | ||
// 1 more document should now be in the result. | ||
// TODO: See previous todo. | ||
// T(results.total_rows == 3); | ||
T(results.total_rows == 3); | ||
@@ -187,4 +179,4 @@ // TODO: Not sure why this is failing? doc_count is 7 apparently... | ||
// 1 less document should now be in the results. | ||
// TODO: Same issue as above, PouchDB doesn't return total_rows. | ||
// T(results.total_rows == 2); | ||
T(results.total_rows == 2); | ||
// TODO: Something is wrong with doc_count on pouchdb | ||
// T(db.info().doc_count == 5); | ||
@@ -191,0 +183,0 @@ |
Sorry, the diff of this file is not supported yet
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
1187329
105
28845
52
2
7