couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From garrensmith <...@git.apache.org>
Subject [GitHub] couchdb-fauxton pull request: grunt works :) with $ grunt nightwat...
Date Mon, 17 Nov 2014 14:10:12 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message