diff --git a/Gruntfile.js b/Gruntfile.js index ca48bd216..336e4373a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -27,7 +27,7 @@ module.exports = function(grunt) { ui: 'bdd', reporter: 'tap' }, - all: { src: ['test/*.js'] } + all: { src: ['test/**/*.js'] } }, jshint: { options: { diff --git a/test/red/comms_spec.js b/test/red/comms_spec.js new file mode 100644 index 000000000..071beceeb --- /dev/null +++ b/test/red/comms_spec.js @@ -0,0 +1,22 @@ +/** + * Copyright 2014 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ +var should = require("should"); + +describe("red/comms", function() { + it('can be required without errors', function() { + require("../../red/comms"); + }); +}); diff --git a/test/red/events_spec.js b/test/red/events_spec.js new file mode 100644 index 000000000..24759262b --- /dev/null +++ b/test/red/events_spec.js @@ -0,0 +1,22 @@ +/** + * Copyright 2014 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ +var should = require("should"); + +describe("red/events", function() { + it('can be required without errors', function() { + require("../../red/events"); + }); +}); diff --git a/test/red/library_spec.js b/test/red/library_spec.js new file mode 100644 index 000000000..564fc43f6 --- /dev/null +++ b/test/red/library_spec.js @@ -0,0 +1,22 @@ +/** + * Copyright 2014 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ +var should = require("should"); + +describe("red/library", function() { + it('can be required without errors', function() { + require("../../red/library"); + }); +}); diff --git a/test/red/log_spec.js b/test/red/log_spec.js new file mode 100644 index 000000000..0fb0aafd5 --- /dev/null +++ b/test/red/log_spec.js @@ -0,0 +1,22 @@ +/** + * Copyright 2014 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ +var should = require("should"); + +describe("red/log", function() { + it('can be required without errors', function() { + require("../../red/log"); + }); +}); diff --git a/test/node_spec.js b/test/red/nodes/Node_spec.js similarity index 99% rename from test/node_spec.js rename to test/red/nodes/Node_spec.js index 123fbf827..9f5111424 100644 --- a/test/node_spec.js +++ b/test/red/nodes/Node_spec.js @@ -15,7 +15,7 @@ **/ var should = require("should"); -var RedNode = require("../red/nodes/Node"); +var RedNode = require("../../../red/nodes/Node"); describe('Node', function() { describe('#constructor',function() { diff --git a/test/credentials_spec.js b/test/red/nodes/credentials_spec.js similarity index 98% rename from test/credentials_spec.js rename to test/red/nodes/credentials_spec.js index 3f090104d..f0b38144f 100644 --- a/test/credentials_spec.js +++ b/test/red/nodes/credentials_spec.js @@ -18,7 +18,7 @@ var should = require("should"); var sinon = require("sinon"); var when = require("when"); -var credentials = require("../red/nodes/credentials"); +var credentials = require("../../../red/nodes/credentials"); describe('Credentials', function() { diff --git a/test/node_flows_spec.js b/test/red/nodes/flows_spec.js similarity index 95% rename from test/node_flows_spec.js rename to test/red/nodes/flows_spec.js index e23c07cfc..45cf63af0 100644 --- a/test/node_flows_spec.js +++ b/test/red/nodes/flows_spec.js @@ -16,10 +16,10 @@ var should = require("should"); var when = require("when"); -var flows = require("../red/nodes/flows"); -var RedNode = require("../red/nodes/Node"); -var RED = require("../red/nodes"); -var events = require("../red/events"); +var flows = require("../../../red/nodes/flows"); +var RedNode = require("../../../red/nodes/Node"); +var RED = require("../../../red/nodes"); +var events = require("../../../red/events"); function loadFlows(testFlows, cb) { var storage = { diff --git a/test/red/nodes/index_spec.js b/test/red/nodes/index_spec.js new file mode 100644 index 000000000..871a2a49d --- /dev/null +++ b/test/red/nodes/index_spec.js @@ -0,0 +1,22 @@ +/** + * Copyright 2014 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ +var should = require("should"); + +describe("red/nodes/index", function() { + it('can be required without errors', function() { + require("../../../red/nodes/index"); + }); +}); diff --git a/test/node_registry_spec.js b/test/red/nodes/registry_spec.js similarity index 91% rename from test/node_registry_spec.js rename to test/red/nodes/registry_spec.js index c83ac15e8..38dde7a5c 100644 --- a/test/node_registry_spec.js +++ b/test/red/nodes/registry_spec.js @@ -15,9 +15,9 @@ **/ var should = require("should"); -var RedNodes = require("../red/nodes"); +var RedNodes = require("../../../red/nodes"); -var RedNode = require("../red/nodes/Node"); +var RedNode = require("../../../red/nodes/Node"); describe('NodeRegistry', function() { it('automatically registers new nodes',function() { diff --git a/test/red/red_spec.js b/test/red/red_spec.js new file mode 100644 index 000000000..f61fd55b7 --- /dev/null +++ b/test/red/red_spec.js @@ -0,0 +1,22 @@ +/** + * Copyright 2014 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ +var should = require("should"); + +describe("red/red", function() { + it('can be required without errors', function() { + require("../../red/red"); + }); +}); diff --git a/test/red/server_spec.js b/test/red/server_spec.js new file mode 100644 index 000000000..b20249ca5 --- /dev/null +++ b/test/red/server_spec.js @@ -0,0 +1,22 @@ +/** + * Copyright 2014 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ +var should = require("should"); + +describe("red/server", function() { + it('can be required without errors', function() { + require("../../red/server"); + }); +}); diff --git a/test/red/storage/index_spec.js b/test/red/storage/index_spec.js new file mode 100644 index 000000000..5778cd282 --- /dev/null +++ b/test/red/storage/index_spec.js @@ -0,0 +1,24 @@ +/** + * Copyright 2014 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ +var should = require("should"); + +describe("red/storage/index", function() { + it('can be required without errors', function() { + var RED = require('../../../red/red'); + RED.init({},{}); + require("../../../red/storage/index"); + }); +}); diff --git a/test/storage_localfilesystem_spec.js b/test/red/storage/localfilesystem_spec.js similarity index 99% rename from test/storage_localfilesystem_spec.js rename to test/red/storage/localfilesystem_spec.js index 2eaa16353..a13117090 100644 --- a/test/storage_localfilesystem_spec.js +++ b/test/red/storage/localfilesystem_spec.js @@ -18,7 +18,7 @@ var should = require("should"); var fs = require('fs-extra'); var path = require('path'); -var localfilesystem = require("../red/storage/localfilesystem"); +var localfilesystem = require("../../../red/storage/localfilesystem"); describe('LocalFileSystem', function() { var userDir = path.join(__dirname,".testUserHome"); diff --git a/test/red/ui_spec.js b/test/red/ui_spec.js new file mode 100644 index 000000000..a3cff7e6d --- /dev/null +++ b/test/red/ui_spec.js @@ -0,0 +1,22 @@ +/** + * Copyright 2014 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ +var should = require("should"); + +describe("red/ui", function() { + it('can be required without errors', function() { + require("../../red/ui"); + }); +});