mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
use implicit logging of context store
This commit is contained in:
@@ -18,7 +18,6 @@ var should = require("should");
|
||||
var sinon = require('sinon');
|
||||
var path = require("path");
|
||||
var Context = require("../../../../../red/runtime/nodes/context/index");
|
||||
var Log = require("../../../../../red/runtime/log");
|
||||
|
||||
describe('context', function() {
|
||||
describe('local memory',function() {
|
||||
@@ -794,36 +793,4 @@ describe('context', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('log', function() {
|
||||
it('should log context store info', function(done) {
|
||||
Context.init({
|
||||
contextStorage: {
|
||||
memory: {
|
||||
module: "memory",
|
||||
congig: {
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
Context.load().then(function() {
|
||||
var loginfo = undefined;
|
||||
var logmsg = undefined;
|
||||
sinon.stub(Log, 'log', function(msg) {
|
||||
loginfo = msg;
|
||||
});
|
||||
sinon.stub(Log, '_', function(msg, info) {
|
||||
logmsg = JSON.stringify(info);
|
||||
return logmsg;
|
||||
});
|
||||
Context.logStores();
|
||||
should.deepEqual(loginfo, {
|
||||
level: Log.INFO,
|
||||
msg: logmsg
|
||||
});
|
||||
Log.log.restore();
|
||||
Log._.restore();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -497,11 +497,4 @@ describe('localfilesystem',function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#info', function() {
|
||||
it('should return info', function() {
|
||||
var context = LocalFileSystem({dir: "/tmp", base: "xyz", cache: true});
|
||||
var info = context.info();
|
||||
info.should.be.equal("module=localfilesystem,base='xyz',dir='/tmp',cache");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -214,11 +214,4 @@ describe('memory',function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#info',function() {
|
||||
it('should return info', function() {
|
||||
var info = context.info();
|
||||
info.should.be.equal("module=memory");
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user