Github user robertkowalski commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/136#discussion_r19955166
--- Diff: test/nightwatch_tests/custom-commands/createDatabase.js ---
@@ -0,0 +1,16 @@
+exports.command = function(databaseName) {
+ var client = this;
+ var nano = client.globals.getNanoInstance();
+
+ nano.db.create(databaseName, function(err, body, header) {
+ if(err){
+ console.log('Error in nano CreateDatabase Function: '+
databaseName, err.message);
+ return;
+ }
+ console.log("nano created a database "+databaseName + body);
+ });
+
+ client.pause(1000);
+
+ return this;
+};
--- End diff --
```javascript
var util = require('util'),
events = require('events'),
helpers = require('../helpers/helpers.js');
function CreateDatabase () {
events.EventEmitter.call(this);
}
// inherit from the node event emitter
util.inherits(CreateDatabase, events.EventEmitter);
CreateDatabase.prototype.command = function (databaseName) {
var self = this,
nano = helpers.getNanoInstance();
nano.db.create(databaseName, function (err, body, header) {
if (err) {
console.log('Error in nano CreateDatabase Function: '+ databaseName,
err.message);
throw err;
}
console.log('nano created a database ' + databaseName + body);
self.emit('complete'); // emit an complete event
});
return this;
};
module.exports = CreateDatabase;
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---