mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge branch 'master' into stop-start-flows
This commit is contained in:
@@ -906,6 +906,7 @@ describe('inject node', function() {
|
||||
msg.should.have.property("str1", "1"); //injected prop
|
||||
msg.should.have.property("num1", 1); //injected prop
|
||||
msg.should.have.property("bool1", true); //injected prop
|
||||
msg.should.have.property("jsonata1", "AB"); //injected prop
|
||||
|
||||
helper.clearFlows().then(function() {
|
||||
done();
|
||||
@@ -919,6 +920,7 @@ describe('inject node', function() {
|
||||
{p:"str1", v:"1", vt:"str"}, //new prop
|
||||
{p:"num1", v:"1", vt:"num"}, //new prop
|
||||
{p:"bool1", v:"true", vt:"bool"}, //new prop
|
||||
{p:"jsonata1", v:'"A" & "B"', vt:"jsonata"}, //new prop
|
||||
]})
|
||||
.expect(200).end(function(err) {
|
||||
if (err) {
|
||||
|
||||
@@ -388,6 +388,19 @@ describe("@node-red/util/util", function() {
|
||||
result[0].should.eql(1);
|
||||
result[1].should.eql(2);
|
||||
});
|
||||
it('throws an error if buffer data is not array or string', function (done) {
|
||||
try {
|
||||
var result = util.evaluateNodeProperty('12','bin');
|
||||
done("should throw an error");
|
||||
} catch (err) {
|
||||
if (err.code === "INVALID_BUFFER_DATA") {
|
||||
done();
|
||||
}
|
||||
else {
|
||||
done("should throw an error");
|
||||
}
|
||||
}
|
||||
});
|
||||
it('returns msg property',function() {
|
||||
var result = util.evaluateNodeProperty('foo.bar','msg',{},{foo:{bar:"123"}});
|
||||
result.should.eql("123");
|
||||
|
||||
Reference in New Issue
Block a user