Update tests for runtime/api separation

This commit is contained in:
Nick O'Leary
2015-11-12 07:56:23 +00:00
parent f43738446e
commit 9f5e6a4b37
53 changed files with 246 additions and 284 deletions

View File

@@ -0,0 +1,3 @@
<script type="text/x-red" data-template-name="test-node-1"></script>
<script type="text/x-red" data-help-name="test-node-1"></script>
<script type="text/javascript">RED.nodes.registerType('test-node-1',{});</script>

View File

@@ -0,0 +1,5 @@
// A test node that exports a function
module.exports = function(RED) {
function DuplicateTestNode(n) {}
RED.nodes.registerType("test-node-1",DuplicateTestNode);
}

View File

@@ -0,0 +1,6 @@
<script type="text/x-red" data-template-name="test-node-multiple-1a"></script>
<script type="text/x-red" data-help-name="test-node-multiple-1a"></script>
<script type="text/javascript">RED.nodes.registerType('test-node-multiple-1a',{});</script>
<script type="text/x-red" data-template-name="test-node-multiple-1b"></script>
<script type="text/x-red" data-help-name="test-node-multiple-1b"></script>
<script type="text/javascript">RED.nodes.registerType('test-node-multiple-1b',{});</script>

View File

@@ -0,0 +1,7 @@
// A test node that exports a function
module.exports = function(RED) {
function TestNode1(n) {}
RED.nodes.registerType("test-node-multiple-1a",TestNode1);
function TestNode2(n) {}
RED.nodes.registerType("test-node-multiple-1b",TestNode2);
}

View File

@@ -0,0 +1,4 @@
<script type="text/x-red" data-template-name="nested-node-1"></script>
<script type="text/x-red" data-help-name="nested-node-1"></script>
<script type="text/javascript">RED.nodes.registerType('nested-node-1',{});</script>
<style></style>

View File

@@ -0,0 +1,5 @@
// A test node that exports a function
module.exports = function(RED) {
function TestNode(n) {}
RED.nodes.registerType("nested-node-1",TestNode);
}

View File

@@ -0,0 +1,3 @@
This file exists just to ensure the 'icons' directory is in the repository.
TODO: a future test needs to ensure the right icon files are loaded - this
directory can be used for that

View File

@@ -0,0 +1,4 @@
<script type="text/x-red" data-template-name="should-not-load-1"></script>
<script type="text/x-red" data-help-name="should-not-load-1"></script>
<script type="text/javascript">RED.nodes.registerType('should-not-load-1',{});</script>
<style></style>

View File

@@ -0,0 +1,5 @@
// A test node that exports a function
module.exports = function(RED) {
function TestNode(n) {}
RED.nodes.registerType("should-not-load-1",TestNode);
}

View File

@@ -0,0 +1,4 @@
<script type="text/x-red" data-template-name="should-not-load-3"></script>
<script type="text/x-red" data-help-name="should-not-load-3"></script>
<script type="text/javascript">RED.nodes.registerType('should-not-load-3',{});</script>
<style></style>

View File

@@ -0,0 +1,5 @@
// A test node that exports a function
module.exports = function(RED) {
function TestNode(n) {}
RED.nodes.registerType("should-not-load-3",TestNode);
}

View File

@@ -0,0 +1,5 @@
<script type="text/x-red" data-template-name="test-node-1"></script>
<script type="text/x-red" data-help-name="test-node-1"></script>
<script type="text/javascript">RED.nodes.registerType('test-node-1',{});</script>
<style></style>
<p>this should be filtered out</p>

View File

@@ -0,0 +1,5 @@
// A test node that exports a function
module.exports = function(RED) {
function TestNode(n) {}
RED.nodes.registerType("test-node-1",TestNode);
}

View File

@@ -0,0 +1,4 @@
<script type="text/x-red" data-template-name="test-node-2"></script>
<script type="text/x-red" data-help-name="test-node-2"></script>
<script type="text/javascript">RED.nodes.registerType('test-node-2',{});</script>
<style></style>

View File

@@ -0,0 +1,10 @@
// A test node that exports a function which returns a resolving promise
var when = require("when");
module.exports = function(RED) {
return when.promise(function(resolve,reject) {
function TestNode(n) {}
RED.nodes.registerType("test-node-2",TestNode);
resolve();
});
}

View File

@@ -0,0 +1,3 @@
<script type="text/x-red" data-template-name="test-node-3"></script>
<script type="text/x-red" data-help-name="test-node-3"></script>
<script type="text/javascript">RED.nodes.registerType('test-node-3',{});</script>

View File

@@ -0,0 +1,8 @@
// A test node that exports a function which returns a rejecting promise
var when = require("when");
module.exports = function(RED) {
return when.promise(function(resolve,reject) {
reject("fail");
});
}