mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Flow.registerType should indicate if type was missing or not
This commit is contained in:
parent
2a57d0b6d0
commit
9daeba02b5
@ -462,8 +462,10 @@ Flow.prototype.typeRegistered = function(type) {
|
||||
if (this.missingTypes.length === 0 && this.started) {
|
||||
this.start();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,7 @@ var activeConfig = [];
|
||||
var activeConfigNodes = {};
|
||||
|
||||
events.on('type-registered',function(type) {
|
||||
if (activeFlow) {
|
||||
activeFlow.typeRegistered(type);
|
||||
if (activeFlow && activeFlow.typeRegistered(type)) {
|
||||
log.info("Missing type registered: "+type);
|
||||
}
|
||||
});
|
||||
|
@ -141,11 +141,16 @@ describe('Flow', function() {
|
||||
|
||||
flow.getMissingTypes().should.eql(["test1","test2"]);
|
||||
|
||||
flow.typeRegistered("test1");
|
||||
var resp = flow.typeRegistered("a-random-node");
|
||||
resp.should.be.false;
|
||||
|
||||
resp = flow.typeRegistered("test1");
|
||||
resp.should.be.true;
|
||||
flow.getMissingTypes().should.eql(["test2"]);
|
||||
flowStart.called.should.be.false;
|
||||
|
||||
flow.typeRegistered("test2");
|
||||
resp = flow.typeRegistered("test2");
|
||||
resp.should.be.true;
|
||||
flow.getMissingTypes().should.eql([]);
|
||||
flowStart.called.should.be.false;
|
||||
} finally {
|
||||
|
Loading…
Reference in New Issue
Block a user