node-red-node-test-helper icon indicating copy to clipboard operation
node-red-node-test-helper copied to clipboard

dependencies / scope

Open boneskull opened this issue 7 years ago • 1 comments
trafficstars

This module should supply a test harness only. It should have examples showing how to use this with test frameworks (e.g. Mocha). A user which wants to test their own flow can install whichever test framework(s( they want to use, and simply consume the helper function(s) as needed.

Thus, any modules which run this helper's tests (if there are any) should be in devDependencies.

I think this should reduce the actual dependencies to perhaps only express. Node.js v4 has Promise support, so when can also be removed.

boneskull avatar Mar 14 '18 17:03 boneskull

The helper currently uses sinon, should, supertest in the helper itself, so will need changes to the code before we can drop those dependencies.

when is used since NR uses it. We implement a flow storage plugin to return the test flow. It's possible that the runtime may depend on having a when promise? (not sure), but don't want to break core tests that may eventually use this code.

Can definitely move mocha to devDependencies right away, and agree we should move the nodes and example tests to examples.

mblackstock avatar Mar 14 '18 18:03 mblackstock