Commit Graph

344 Commits

Author SHA1 Message Date
HirokiUchikawa 83a8979309 Add test cases accessing context with JSONata to Switch Node 2018-07-17 17:46:21 +09:00
HirokiUchikawa 3a8aaee5d7 Add test cases accessing context with JSONata to Join Node 2018-07-16 18:42:16 +09:00
HirokiUchikawa 4fcf57d42c Add test cases accessing context with JSONata to Change Node 2018-07-16 18:25:03 +09:00
Nick O'Leary d21e719cc1
Merge pull request #1812 from node-red-hitachi/0.19-add-env-var-support-for-split-node
Allow environment variable as reduce init value in split node
2018-07-16 09:38:26 +01:00
Hiroyasu Nishiyama 312e3611b1 allow environment variable as reduce init value 2018-07-16 13:45:59 +09:00
Nick O'Leary 46acc62279
Make Trigger node timeout test 1ms more tolerable 2018-07-15 21:13:02 +01:00
Nick O'Leary 7fca04404e
Fix debug test for _enc_ change 2018-07-14 23:18:55 +01:00
Nick O'Leary 5b76c91004
Merge pull request #1806 from node-red-hitachi/0.19-template-node-for-persistable-context
Add support of persistable context to template node
2018-07-14 22:40:50 +01:00
Nick O'Leary 5a0a7b907b
Merge pull request #1809 from node-red-hitachi/0.19-fix-tests-for-trigger-node
Add multiple persistable store tests for trigger node
2018-07-14 22:39:05 +01:00
Nick O'Leary 6a2b1669b3
Merge pull request #1808 from node-red-hitachi/0.19-fix-tests-for-inject-node
Add multiple persistable store tests for inject node
2018-07-14 22:38:58 +01:00
Hiroyasu Nishiyama 91992b48c1 add multiple persistable store tests 2018-07-14 12:15:26 +09:00
Hiroyasu Nishiyama c9a335a6f9 add multiple persistable store tests 2018-07-14 11:50:49 +09:00
Hiroyasu Nishiyama b7ed159b50 add multiple persistable context tests 2018-07-14 11:00:57 +09:00
Hiroyasu Nishiyama c72961a52a add support of persistable context to template node 2018-07-14 00:11:59 +09:00
Kazuhito Yokoi 761161a8e5 Fix async problem in test cases 2018-07-13 17:34:04 +09:00
Kazuhito Yokoi 590506e306 Add test cases of persistable context for trigger node 2018-07-13 15:26:07 +09:00
Kazuhito Yokoi d53ced7830 Add test cases of persistable context for inject node 2018-07-12 16:26:16 +09:00
Nick O'Leary c2675600f6
Fix Switch msg sequence test 2018-07-11 16:37:18 +01:00
Nick O'Leary 6f087b4ec1
Merge pull request #1795 from node-red-hitachi/0.19-fix-change-for-persistable-context
Fix persistable context handling of switch node
2018-07-11 16:17:26 +01:00
Nick O'Leary e94708606d
Add isEmpty check to switch node 2018-07-11 16:14:09 +01:00
Hiroyasu Nishiyama c248f1a762 fix persistable context handling of switch node 2018-07-11 23:39:34 +09:00
Nathanaël Lécaudé eea85485e6 Merge remote-tracking branch 'upstream/0.19' into json-schema 2018-07-10 11:11:15 -04:00
Nick O'Leary d7adff9a65
Add async message handling to Trigger node 2018-07-09 14:12:44 +01:00
Nick O'Leary fc9cdb61f2
Add async property handling to Switch node 2018-07-09 11:31:10 +01:00
Nick O'Leary 1b693eed37
Add async context support to Change node 2018-07-09 11:31:10 +01:00
Nathanaël Lécaudé 6a218814d3 Merge remote-tracking branch 'upstream/0.19' into json-schema 2018-06-30 16:20:13 -07:00
Nathanaël Lécaudé 905f89b0f5 JSON node: finalize JSON Schema validation 2018-06-30 16:19:39 -07:00
Dave Conway-Jones 6f5974f875
Fix join node manual mode array
msg.complete was adding an unwanted null to the array (if no payload)
Added tests for msg.complete with array and object
2018-06-14 20:00:42 +01:00
Nick O'Leary 56db1da3cf
Merge pull request #1732 from node-red/pi-nodes-editable-when-na
let Pi nodes be visible/editable on all platforms
2018-06-13 15:46:21 +01:00
Nick O'Leary fef71f29c4
Merge pull request #1750 from node-red-hitachi/logic-nodes-test
Add test cases for logic nodes
2018-06-13 15:45:13 +01:00
KatsuyaHoshii b204b183de Add logic nodes test cases 2018-06-01 14:33:20 +09:00
Nick O'Leary 245a8adbf9
Merge pull request #1736 from node-red-hitachi/0.19-httpreq
Move to request module
2018-05-30 10:18:21 +01:00
Nick O'Leary 0ff0f25aaf
Merge branch 'master' into 0.19 2018-05-25 13:58:15 +01:00
Nick O'Leary 252df81f59
Pass Date into the Function node sandbox to fix instanceof tests 2018-05-25 10:55:44 +01:00
Dave Conway-Jones 3df3d6f516
add debug to trigger test to help work out fails 2018-05-24 10:02:51 +01:00
HirokiUchikawa 9fd5d1db56 Move to request module 2018-05-23 17:16:20 +09:00
Dave Conway-Jones 1d05b4c981
relax test spec slightly 2018-05-23 08:58:04 +01:00
HirokiUchikawa 61f6535be8 Add test case for preventing following redirect 2018-05-23 16:54:03 +09:00
Dave Conway-Jones 7dd329b5ee
Add basic loading tests for GPIO nodes 2018-05-22 17:26:52 +01:00
Nick O'Leary eb6d093e56
Add env-var support to TypedInput 2018-05-21 15:10:06 +01:00
Hiroyasu Nishiyama af1ea610ea allow id and name reference in function node code (#1731) 2018-05-21 11:34:56 +01:00
Nick O'Leary 3b5a2815a9
Merge master 2018-05-08 23:27:27 +01:00
Nick O'Leary 98546b6e6a
Fixup Function node error line reporting 2018-05-08 11:40:16 +01:00
Nick O'Leary 2fef6fd1fa
Fix proper closing of http request test ssl/proxy servers 2018-05-08 11:26:28 +01:00
Nick O'Leary 880af0671a
Merge branch 'pr_1706' 2018-05-08 10:44:35 +01:00
Dave Conway-Jones 4a4513a746 Add type checks to switch node options (#1714)
* Add type checks to switch node options

* add isType to messages.json
2018-05-03 11:24:44 +01:00
Nick O'Leary ae4b1b17a9
Increase trigger node test timings 2018-05-01 12:59:53 +01:00
Dave Conway-Jones 3190de873e add output property select to HTML parse node (#1701) 2018-05-01 12:42:27 +01:00
Christopher Hiller e1195ac00a fix many test problems (#1677)
* fix many test problems

- adds [stoppable](https://npm.im/stoppable) to force-stop net & http
  servers
- upgrades to latest mocha
- much cleanup of servers
- some removal of useless code

Signed-off-by: Christopher Hiller <boneskull@boneskull.com>

* increase wait time to hack at race condition

* PoC with fork of stoppable

Signed-off-by: Christopher Hiller <boneskull@boneskull.com>

* fix custom stoppable url for newer npm

* make travis go faster; attempt to avoid npm troubles

* fix coveralls executable path

* add extra time for flake to trigger spec

Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
2018-04-23 12:37:26 +01:00
KatsuyaHoshii 6cd9ccc37c Refactor test cases 2018-04-23 14:31:37 +09:00
Nick O'Leary f31f23ff07
Allow template node to be updated more than once
Fixes #1671
2018-03-27 10:14:39 +01:00
KatsuyaHoshii c9e2fce94d test for httprequest node 2018-03-27 16:09:04 +09:00
Christopher Hiller 6e2e36e7a0
tcp: queue messages while connecting; closes #1414
- queues messages on a per-client basis while waiting for TCP server
  connection
- add `denque` package for performance (`shift()` happens in constant
  instead of `Array`'s linear time)
- add tests
- remove a duplicate test in `31-tcp_request.spec.js`
- cap queue at value specified in settings (`tcpMsgQueueSize`); default
  to 1000
- add `tcpMsgQueueSize` to `settings.js`

Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
2018-03-20 13:45:44 -07:00
Christopher Hiller 9994df9601
tcprequest tests: normalize indents 2018-03-20 13:45:44 -07:00
Dave Conway-Jones 087cd121b8 add debug and trace to function node (#1654) 2018-03-20 20:40:36 +00:00
Dave Conway-Jones 7e416797e9
make trigger test a bit more robust 2018-03-19 17:33:18 +00:00
mblackstock 10d8ca30b0 use node-red-node-test-helper for node tests 2018-03-01 20:41:16 -08:00
Dave Conway-Jones 4ebb5d099e
add trigger reset test for null on 2nd output 2018-03-01 14:00:14 +00:00
Hiroyasu Nishiyama 6252b075bc fixed message modificcation of concat mode of BATCH node 2018-02-13 20:55:03 +09:00
Dave Conway-Jones b0c876019a
let HTML node use alternative msg property 2018-01-30 16:11:25 +00:00
Hiroyasu Nishiyama 3f2a92e801 evaluate init value on each reduction 2018-01-29 22:30:47 +09:00
Nick O'Leary 9353d5c1c4
Merge pull request #1585 from node-red-hitachi/fix-HTML
fix HTML node not to reuse message object for multiple output messages
2018-01-29 11:16:20 +00:00
Hiroyasu Nishiyama 34e46fc6d3 fix behavior of msg per line mode of FILE IN node with empty line 2018-01-28 21:27:15 +09:00
Hiroyasu Nishiyama 8516f41ba8 do not reuse message object for multiple outputs 2018-01-28 14:37:34 +09:00
Dave Conway-Jones 8179813fe1
let HTML node return empty array for no matching input.
to Close #1582
2018-01-26 14:26:54 +00:00
Hiroyasu Nishiyama 2753075180 fix bugs in SWITCH updates 2018-01-26 12:39:07 +09:00
Nick O'Leary e7960d1d44
Rewording some of the message sequence nodes (#1564)
* Rewording some of the message sequence nodes

* Fix batch test for overlap renaming

* Finish msg-sequence node help rewording

* Rename maxKeptMsgsCount to nodeMessageBufferMaxLength

* Rename nodeMessageBufferMaxLength in tests

* Remove Join-merge mode for later rework
2018-01-24 22:01:07 +00:00
Nick O'Leary dc3d89008d
Merge pull request #1561 from node-red/add-property-select
Add property select to various core nodes
2018-01-23 17:06:31 +00:00
Hiroyasu Nishiyama a75b819858 reduce *MaxKeptMsgsCount property to one maxKeptMsgsCount (#1563) 2018-01-22 23:26:17 +00:00
Hiroyasu Nishiyama 6b466d217a update UI for SORT node (#1567)
* update UI of SORT node

* fix maxKeptMsgsCount of SORT node
2018-01-22 00:23:22 +00:00
Hiroyasu Nishiyama 6310de0d20 Initial support of sequence rules for SWITCH node (#1545)
* new UI for parts support of SWITCH node

* update UI of SWITCH node for parts support

* add server side code of new SWITCH node

* update info document of SWITCH node

* add tests for new SWITCH node features

* add test for too many pending messages & related fixes

* fix handling when msg is undefined

* tabs -> spaces

* fixed meaning of "repair sequence" in SWITCH node docs

* add a note on restricting internally kept messages

* change label and position in menu of "pos. between" rule

* fixed typos (again, sorry)
2018-01-17 10:08:58 +00:00
Hiroyasu Nishiyama 218794be77 Initial support of merge & reduce mode for JOIN node (#1546)
* initial support of merge mode of JOIN node

* initial support of reduce mode of JOIN node

* update info document of JOIN node

* add tests for merge & reduce mode of JOIN node

* tidy tabs & spaces

* add test for too many pending messages & related fixes

* add an test for reduce mode of JOIN node

* change order of modes of SWITCH node

* add initial topics entry of merge mode

* fixed descriptions on "reduce right" checkbox

* fixed update of typedInput field of reduce mode

* fixed a typo in info document of JOIN node

* allow empty string in JSONata input field of reduce mode

* fixed a typo

* fixed error in reduce mode description
2018-01-17 10:08:23 +00:00
Hiroyasu Nishiyama af71ae649b Initial support of new BATCH node (#1548)
* initial support of BATCH node

* add concat mode & fix for docs and js code

* add tests for BATCH node

* minor correction of typo

* allow interval in float

* fixed message catalog

* add test for too many pending messages & related fixes

* update info document on batchMaxKeptMsgsCount

* fixed close callback

* fixed info document

* add initial topics entry of concat mode
2018-01-17 10:05:01 +00:00
Dave Conway-Jones 9bc72c1a06 let trigger node be reset by boolean message (#1554)
* let trigger node be reset by boolean message

with test

* fix trigger node boolean reset check to work with false

and add test
2018-01-17 09:51:53 +00:00
Dave Conway-Jones e793a1e1aa
add property choice to xml, sentiment nodes
add tests
2018-01-16 21:43:37 +00:00
Nick O'Leary dd23e03342
Add option to JSON node to ensure particular encoding 2018-01-14 23:19:01 +00:00
Nick O'Leary 4453a51211
Tidy up properly between file node tests 2018-01-14 01:06:55 +00:00
Nick O'Leary 242e35c212
Fix file tests now the node properly creates directories 2018-01-14 00:44:33 +00:00
Nick O'Leary cb4120ec4b
Watch node - filter subdir events in tests because fs.notify is inconsistent 2018-01-13 23:24:41 +00:00
Nick O'Leary 5cfbb87bee
Fix global leak in watch tests (again x2) 2018-01-13 23:14:01 +00:00
Nick O'Leary 9e472ed83c
Fix global leak in watch tests (again) 2018-01-13 23:00:05 +00:00
Nick O'Leary ebca753fc4
Fix global leak in watch tests 2018-01-13 22:59:05 +00:00
Nick O'Leary 8ffabf1813
Make Watch node test more reliable
- tidied up some unnecessary code
 - removed the 'size' check as that is highly prone to timing issues
2018-01-13 22:48:35 +00:00
Nick O'Leary 1f40d4f941
Update package dependencies 2018-01-13 22:00:43 +00:00
Dave Conway-Jones 7b1787fdbb Debug to status option (#1499)
* Let debug optionally target the status line (32 chars only)

* Add batching of messages to debug ws comms

* let Debug handle simple case of NaN

would also close #1530

* Fixup debug tests for batch comms (no new tests yet)

* mixup comms/api test to match new batch mode (no new tests)

* Add test for NaN being sent OK.

* redo original fix to padding / labels for new debug options

* fix debug test (re-add fix from #1444)

* Fix up merge issues in debug tests
2018-01-13 16:14:03 +00:00
Dave Conway-Jones 7c0b9ffe06 Add skip first n lines capability to csv node (#1535)
* Initial implementation of skip first lines for css node

* add css skip lines tests
2018-01-11 22:02:58 +00:00
Klaus Landsdorf 4ff6e792cd Inject node - let once delay be editable (#1541)
* inject once with delay

* test for inject delay at once works

* give access to the once delay of the inject node

* change event not needed in HTML

* code review with Dave

* rename test

* tests for default and optional delay

* test once with delay and repeat
2018-01-11 21:50:53 +00:00
Dave Conway-Jones f737ea96f3
Don't send message if it doesn't exist. and give it time not to exist.
to close #1527
2017-12-19 17:54:26 +00:00
Hiroyasu Nishiyama d7c8adfd82 Fix handling of too many pending messages in SORT node (#1514)
* initial support of SORT node

minor fix of sort node

fixed error message of sort node

fixed error handling of SORT node

add test case for SORT node

make limit of messages count computed once in SORT node

* update type in message & info description

* fix handling of pending messages in SORT node
2017-12-06 19:44:46 +00:00
Dave Conway-Jones b98d1216b1
ignore _msgid when merging full objects
to hand code and close #1423
2017-12-05 21:45:43 +00:00
Dave Conway-Jones 27db727321
Let CSV correct parts if we remove header row.
and add test
2017-12-05 17:34:49 +00:00
Hiroyasu Nishiyama 6d2fd2e641 add parts support for CSV node (#1496)
* add parts support for CSV node

* make CSV node to preserve incoming parts property
2017-12-05 15:39:51 +00:00
Hiroyasu Nishiyama afce106186 initial support of SORT node (#1500)
* initial support of SORT node

minor fix of sort node

fixed error message of sort node

fixed error handling of SORT node

add test case for SORT node

make limit of messages count computed once in SORT node

* update type in message & info description
2017-12-05 14:54:03 +00:00
Ross Cruickshank f21c8154ed enable template config via msg.template for stored or generated templates (#1503)
* updates to 80-template to allow setting template with msg.template

* updated 80-template_spec test for msg.template support

* fixed 80-template.js test
2017-12-05 12:24:06 +00:00
Nick O'Leary 64191e8303
Merge master to 0.18 2017-12-03 22:32:28 +00:00
Hiroyasu Nishiyama 806457063f add parts support for HTML node (#1495)
* add parts support for HTML node

* add parts.{type,ch} to output of HTML node
2017-12-01 13:09:05 +00:00
Hiroyasu Nishiyama d7f0102aa2 add test for WATCH node (#1493) 2017-11-30 13:48:52 +00:00
Dave Conway-Jones cc88ebd2b9 Let trigger node support per topic mode (#1398)
* Let trigger node support per topic mode

* ensure trigger node clones repeating message

* Add some tests for trigger by topic

* test trigger repeat for pass by ref error

* trigger test - add missing try/catch to all test with callback

* boost trigger node test coverage
2017-11-17 17:35:18 +00:00
Jim Turner 6baedf909d Fix #1478 - Project files are not being flushed to disk after being written (#1479)
* Call fsync() before closing file

* Fix race condition in tests due to incorrect stub.

The startFlows() function wasn't really being stubbed, so it was still being called. But there was no corresponding call to stopFlows().

In later tests, the check in Flows.init() was throwing the "Cannot init without a stop" error.

* Test coverage for fsync() calls

For issue #1478

* Revert "Fix race condition in tests due to incorrect stub."

This reverts commit 4f71d7851b.

* Fix race condition in tests due to incorrect stub.

The startFlows() function wasn't really being stubbed, so it was still being called. But there was no corresponding call to stopFlows().

In later tests, the check in Flows.init() was throwing the "Cannot init without a stop" error.

* Fix intermittent test failure in Exec node.

Occasionally, the error text on stderr will come in more than one piece. The test only worked correctly if a single message was received.
2017-11-17 17:29:33 +00:00
Kazuhito Yokoi ab61a95f83 Add test cases for change node (#1476) 2017-11-17 17:26:36 +00:00