1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge pull request #277 from hindessm/realistic-test-coverage

Make test coverage figure more realistic.
This commit is contained in:
Nick O'Leary 2014-07-17 12:21:51 +01:00
commit 8f3de41049
15 changed files with 210 additions and 10 deletions

View File

@ -27,7 +27,7 @@ module.exports = function(grunt) {
ui: 'bdd',
reporter: 'tap'
},
all: { src: ['test/*.js'] }
all: { src: ['test/**/*.js'] }
},
jshint: {
options: {

22
test/red/comms_spec.js Normal file
View File

@ -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");
});
});

22
test/red/events_spec.js Normal file
View File

@ -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");
});
});

22
test/red/library_spec.js Normal file
View File

@ -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");
});
});

22
test/red/log_spec.js Normal file
View File

@ -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");
});
});

View File

@ -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() {

View File

@ -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() {

View File

@ -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 = {

View File

@ -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");
});
});

View File

@ -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() {

22
test/red/red_spec.js Normal file
View File

@ -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");
});
});

22
test/red/server_spec.js Normal file
View File

@ -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");
});
});

View File

@ -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");
});
});

View File

@ -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");

22
test/red/ui_spec.js Normal file
View File

@ -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");
});
});