UNPKG

@apidaze/node-red-contrib-apidaze

Version:
35 lines (25 loc) 881 B
const test = require('ava'); const helper = require('node-red-node-test-helper'); const sinon = require('sinon'); const nosql = require('nosql'); const createNodeMacros = require('../macros'); sinon.stub(nosql, 'load').returns([]); const node = require('../../nodes/message-processor/message-processor'); const nodeType = 'message-processor'; const { loadTest, invalidTypeTest } = createNodeMacros(nodeType, node, helper); helper.init(require.resolve('node-red')); test.serial.before.cb((t) => { helper.startServer(t.end); }); test.serial.cb('should be loaded properly', loadTest); test.serial.cb( 'should not let flow proceed for non-message payloads', invalidTypeTest ); test.serial.todo('should let flow proceed for message payloads'); test.serial.afterEach(async () => { await helper.unload(); }); test.serial.after.cb((t) => { helper.stopServer(t.end); });