mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-13 19:12:49 +00:00
updated package.json
This commit is contained in:
38
node_modules/nconf/test/mocks/mock-store.js
generated
vendored
Normal file
38
node_modules/nconf/test/mocks/mock-store.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* mock-store.js: Mock store for ensuring certain operations are actually called.
|
||||
*
|
||||
* (C) 2011, Nodejitsu Inc.
|
||||
*
|
||||
*/
|
||||
|
||||
var util = require('util'),
|
||||
events = require('events'),
|
||||
nconf = require('../../lib/nconf');
|
||||
|
||||
var Mock = nconf.Mock = function () {
|
||||
events.EventEmitter.call(this);
|
||||
this.type = 'mock';
|
||||
};
|
||||
|
||||
// Inherit from Memory store.
|
||||
util.inherits(Mock, events.EventEmitter);
|
||||
|
||||
//
|
||||
// ### function save (value, callback)
|
||||
// #### @value {Object} _Ignored_ Left here for consistency
|
||||
// #### @callback {function} Continuation to respond to when complete.
|
||||
// Waits `1000ms` and then calls the callback and emits the `save` event.
|
||||
//
|
||||
Mock.prototype.save = function (value, callback) {
|
||||
if (!callback && typeof value === 'function') {
|
||||
callback = value;
|
||||
value = null;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
setTimeout(function () {
|
||||
self.emit('save');
|
||||
callback();
|
||||
}, 1000);
|
||||
};
|
||||
Reference in New Issue
Block a user