mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Register node message catalog directly, not via event
This commit is contained in:
@@ -45,7 +45,7 @@ describe("red/nodes/registry/localfilesystem",function() {
|
||||
}
|
||||
describe("#getNodeFiles",function() {
|
||||
it("Finds all the node files in the resources tree",function(done) {
|
||||
localfilesystem.init({events:{emit:function(){}},settings:{}});
|
||||
localfilesystem.init({i18n:{registerMessageCatalog:function(){}},events:{emit:function(){}},settings:{}});
|
||||
var nodeList = localfilesystem.getNodeFiles(resourcesDir,true);
|
||||
nodeList.should.have.a.property("node-red");
|
||||
var nm = nodeList['node-red'];
|
||||
@@ -56,7 +56,7 @@ describe("red/nodes/registry/localfilesystem",function() {
|
||||
done();
|
||||
});
|
||||
it("Excludes node files from settings",function(done) {
|
||||
localfilesystem.init({events:{emit:function(){}},settings:{nodesExcludes:['TestNode1.js']}});
|
||||
localfilesystem.init({i18n:{registerMessageCatalog:function(){}},events:{emit:function(){}},settings:{nodesExcludes:['TestNode1.js']}});
|
||||
var nodeList = localfilesystem.getNodeFiles(resourcesDir,true);
|
||||
nodeList.should.have.a.property("node-red");
|
||||
var nm = nodeList['node-red'];
|
||||
@@ -66,7 +66,7 @@ describe("red/nodes/registry/localfilesystem",function() {
|
||||
done();
|
||||
});
|
||||
it("Finds nodes in userDir/nodes",function(done) {
|
||||
localfilesystem.init({events:{emit:function(){}},settings:{userDir:userDir}});
|
||||
localfilesystem.init({i18n:{registerMessageCatalog:function(){}},events:{emit:function(){}},settings:{userDir:userDir}});
|
||||
var nodeList = localfilesystem.getNodeFiles(__dirname,true);
|
||||
nodeList.should.have.a.property("node-red");
|
||||
var nm = nodeList['node-red'];
|
||||
@@ -77,7 +77,7 @@ describe("red/nodes/registry/localfilesystem",function() {
|
||||
});
|
||||
|
||||
it("Finds nodes in settings.nodesDir (string)",function(done) {
|
||||
localfilesystem.init({events:{emit:function(){}},settings:{nodesDir:userDir}});
|
||||
localfilesystem.init({i18n:{registerMessageCatalog:function(){}},events:{emit:function(){}},settings:{nodesDir:userDir}});
|
||||
var nodeList = localfilesystem.getNodeFiles(__dirname,true);
|
||||
nodeList.should.have.a.property("node-red");
|
||||
var nm = nodeList['node-red'];
|
||||
@@ -87,7 +87,7 @@ describe("red/nodes/registry/localfilesystem",function() {
|
||||
done();
|
||||
});
|
||||
it("Finds nodes in settings.nodesDir (array)",function(done) {
|
||||
localfilesystem.init({events:{emit:function(){}},settings:{nodesDir:[userDir]}});
|
||||
localfilesystem.init({i18n:{registerMessageCatalog:function(){}},events:{emit:function(){}},settings:{nodesDir:[userDir]}});
|
||||
var nodeList = localfilesystem.getNodeFiles(__dirname,true);
|
||||
nodeList.should.have.a.property("node-red");
|
||||
var nm = nodeList['node-red'];
|
||||
@@ -106,7 +106,7 @@ describe("red/nodes/registry/localfilesystem",function() {
|
||||
}
|
||||
return _join.apply(null,arguments);
|
||||
}));
|
||||
localfilesystem.init({events:{emit:function(){}},settings:{}});
|
||||
localfilesystem.init({i18n:{registerMessageCatalog:function(){}},events:{emit:function(){}},settings:{}});
|
||||
var nodeList = localfilesystem.getNodeFiles(moduleDir,false);
|
||||
nodeList.should.have.a.property("node-red");
|
||||
var nm = nodeList['node-red'];
|
||||
@@ -141,7 +141,7 @@ describe("red/nodes/registry/localfilesystem",function() {
|
||||
}
|
||||
return _join.apply(null,arguments);
|
||||
}));
|
||||
localfilesystem.init({events:{emit:function(){}},settings:{}},moduleDir,true);
|
||||
localfilesystem.init({i18n:{registerMessageCatalog:function(){}},events:{emit:function(){}},settings:{}},moduleDir,true);
|
||||
var nodeModule = localfilesystem.getModuleFiles('TestNodeModule');
|
||||
nodeModule.should.have.a.property('TestNodeModule');
|
||||
nodeModule['TestNodeModule'].should.have.a.property('name','TestNodeModule');
|
||||
@@ -165,7 +165,7 @@ describe("red/nodes/registry/localfilesystem",function() {
|
||||
}
|
||||
return _join.apply(null,arguments);
|
||||
}));
|
||||
localfilesystem.init({events:{emit:function(){}},settings:{}},moduleDir,true);
|
||||
localfilesystem.init({i18n:{registerMessageCatalog:function(){}},events:{emit:function(){}},settings:{}},moduleDir,true);
|
||||
/*jshint immed: false */
|
||||
(function(){
|
||||
localfilesystem.getModuleFiles('WontExistModule');
|
||||
|
Reference in New Issue
Block a user