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

Update debug tests to handle compact comms format

This commit is contained in:
Nick O'Leary 2021-05-13 14:18:11 +01:00
parent fdf58e1225
commit 74628b7034
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -104,7 +104,7 @@ describe('debug node', function() {
}, function(msg) { }, function(msg) {
JSON.parse(msg).should.eql([{ JSON.parse(msg).should.eql([{
topic:"debug", topic:"debug",
data:{id:"n1",msg:'{\n "payload": "test"\n}',format:"Object",path:"global"} data:{id:"n1",msg:'{"payload":"test"}',format:"Object",path:"global"}
}]); }]);
}, done); }, done);
}); });
@ -119,7 +119,7 @@ describe('debug node', function() {
}, function(msg) { }, function(msg) {
JSON.parse(msg).should.eql([{ JSON.parse(msg).should.eql([{
topic:"debug", topic:"debug",
data:{id:"n1",msg:'{\n "payload": "test"\n}',format:"Object",path:"global"} data:{id:"n1",msg:'{"payload":"test"}',format:"Object",path:"global"}
}]); }]);
}, function() { }, function() {
try { try {
@ -259,7 +259,7 @@ describe('debug node', function() {
}, function(msg) { }, function(msg) {
JSON.parse(msg).should.eql([{ JSON.parse(msg).should.eql([{
topic:"debug", topic:"debug",
data:{id:"n1",msg:'{\n "type": "foo"\n}',property:"payload",format:"Object",path:"global"} data:{id:"n1",msg:'{"type":"foo"}',property:"payload",format:"Object",path:"global"}
}]); }]);
}, done); }, done);
}); });
@ -274,7 +274,7 @@ describe('debug node', function() {
}, function(msg) { }, function(msg) {
JSON.parse(msg).should.eql([{ JSON.parse(msg).should.eql([{
topic:"debug", topic:"debug",
data:{id:"n1",msg: '[\n 0,\n 1,\n 2,\n 3\n]',format:"array[4]", data:{id:"n1",msg: '[0,1,2,3]',format:"array[4]",
property:"payload",path:"global"} property:"payload",path:"global"}
}]); }]);
}, done); }, done);
@ -294,7 +294,7 @@ describe('debug node', function() {
topic:"debug", topic:"debug",
data:{ data:{
id:"n1", id:"n1",
msg:'{\n "name": "bar",\n "o": "[Circular ~]"\n}', msg:'{"name":"bar","o":"[Circular ~]"}',
property:"payload",format:"Object",path:"global" property:"payload",format:"Object",path:"global"
} }
}]); }]);
@ -310,7 +310,7 @@ describe('debug node', function() {
n1.emit("input", {payload: {type:'foo'}}); n1.emit("input", {payload: {type:'foo'}});
}, function(msg) { }, function(msg) {
JSON.parse(msg).should.eql([{ JSON.parse(msg).should.eql([{
topic:"debug",data:{id:"n1",msg:'{\n "type": "foo"\n}',property:"payload",format:"Object",path:"global"} topic:"debug",data:{id:"n1",msg:'{"type":"foo"}',property:"payload",format:"Object",path:"global"}
}]); }]);
}, function() { }, function() {
try { try {
@ -406,7 +406,7 @@ describe('debug node', function() {
topic:"debug", topic:"debug",
data:{ data:{
id:"n1", id:"n1",
msg:'{\n "foo": "'+Array(1001).join("X")+'..."\n}', msg:'{"foo":"'+Array(1001).join("X")+'..."}',
property:"payload", property:"payload",
format:"Object", format:"Object",
path:"global" path:"global"
@ -433,7 +433,7 @@ describe('debug node', function() {
type: "array", type: "array",
data: Array(1000).fill("X"), data: Array(1000).fill("X"),
length: 1001 length: 1001
},null," "), }),
property:"payload", property:"payload",
format:"array[1001]", format:"array[1001]",
path:"global" path:"global"
@ -462,7 +462,7 @@ describe('debug node', function() {
data: Array(1000).fill("X"), data: Array(1000).fill("X"),
length: 1001 length: 1001
} }
},null," "), }),
property:"payload", property:"payload",
format:"Object", format:"Object",
path:"global" path:"global"
@ -513,7 +513,7 @@ describe('debug node', function() {
__enc__: true, __enc__: true,
length: 1001 length: 1001
} }
},null," "), }),
property:"payload", property:"payload",
format:"Object", format:"Object",
path:"global" path:"global"