Github user garrensmith commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/136#discussion_r20436646
--- Diff: test/nightwatch_tests/custom-commands/deleteDatabase.js ---
@@ -0,0 +1,27 @@
+var util = require('util'),
+ events = require('events'),
+ helpers = require('../helpers/helpers.js');
+
+function DeleteDatabase () {
+ events.EventEmitter.call(this);
+}
+
+util.inherits(DeleteDatabase, events.EventEmitter);
+
+DeleteDatabase.prototype.command = function (databaseName) {
+ var self = this,
+ nano = helpers.getNanoInstance();
+
+ nano.db.destroy(databaseName, function (err, body, header) {
+ if (err) {
+ console.log('Error in nano DeleteDatabase Function: '+ databaseName,
err.message);
+ }
+ console.log('nano - database: '+databaseName+' is deleted: ', body);
+ // emit the complete event
+ self.emit('complete');
--- End diff --
I'm probably missing some context but why do we have to emit complete here?
Also can you change `self` to `that`.
---
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.
---