1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Don't filter errored nodes in result list

This commit is contained in:
Nick O'Leary 2014-09-20 22:42:48 +01:00
parent ea89aff3db
commit c98b9dfaa3
2 changed files with 12 additions and 5 deletions

View File

@ -589,7 +589,11 @@ function loadNodeModule(node) {
function loadNodeList(nodes) { function loadNodeList(nodes) {
var promises = []; var promises = [];
nodes.forEach(function(node) { nodes.forEach(function(node) {
if (!node.err) {
promises.push(loadNodeModule(node)); promises.push(loadNodeModule(node));
} else {
promises.push(node);
}
}); });
return when.settle(promises).then(function(results) { return when.settle(promises).then(function(results) {

View File

@ -361,11 +361,14 @@ describe('NodeRegistry', function() {
typeRegistry.load("wontexist",true).then(function(){ typeRegistry.load("wontexist",true).then(function(){
var list = typeRegistry.getNodeList(); var list = typeRegistry.getNodeList();
list.should.be.an.Array.and.be.empty; list.should.be.an.Array.and.be.empty;
typeRegistry.addNode(resourcesDir + "DoesNotExist/DoesNotExist.js").then(function(node) { typeRegistry.addNode(resourcesDir + "DoesNotExist/DoesNotExist.js").then(function(nodes) {
done(new Error("ENOENT not thrown")); nodes.should.be.an.Array.and.have.lengthOf(1);
}).otherwise(function(e) { nodes[0].should.have.property("id");
e.code.should.eql("ENOENT"); nodes[0].should.have.property("types",[]);
nodes[0].should.have.property("err");
done(); done();
}).otherwise(function(e) {
done(e);
}); });
}).catch(function(e) { }).catch(function(e) {