mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
add check for NaN in is of type number to be false
and add test to fix issue #3408
This commit is contained in:
@@ -310,6 +310,12 @@ describe('switch Node', function() {
|
||||
it('should check if payload if of type number 0', function(done) {
|
||||
genericSwitchTest("istype", "number", true, true, 0, done);
|
||||
});
|
||||
it('should check if payload if of type number NaN', function(done) {
|
||||
genericSwitchTest("istype", "number", true, false, parseInt("banana"), done);
|
||||
});
|
||||
it('should check if payload if of type number Infinity', function(done) {
|
||||
genericSwitchTest("istype", "number", true, true, 1/0, done);
|
||||
});
|
||||
it('should check if payload if of type boolean true', function(done) {
|
||||
genericSwitchTest("istype", "boolean", true, true, true, done);
|
||||
});
|
||||
|
Reference in New Issue
Block a user