Skip to content

Commit

Permalink
Merge pull request #277 from hindessm/realistic-test-coverage
Browse files Browse the repository at this point in the history
Make test coverage figure more realistic.
  • Loading branch information
knolleary committed Jul 17, 2014
2 parents fea68d4 + 2778c38 commit 8f3de41
Show file tree
Hide file tree
Showing 15 changed files with 210 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function(grunt) {
ui: 'bdd',
reporter: 'tap'
},
all: { src: ['test/*.js'] }
all: { src: ['test/**/*.js'] }
},
jshint: {
options: {
Expand Down
22 changes: 22 additions & 0 deletions test/red/comms_spec.js
Original file line number Diff line number Diff line change
@@ -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 changes: 22 additions & 0 deletions test/red/events_spec.js
Original file line number Diff line number Diff line change
@@ -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 changes: 22 additions & 0 deletions test/red/library_spec.js
Original file line number Diff line number Diff line change
@@ -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 changes: 22 additions & 0 deletions test/red/log_spec.js
Original file line number Diff line number Diff line change
@@ -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");
});
});
2 changes: 1 addition & 1 deletion test/node_spec.js → test/red/nodes/Node_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {

Expand Down
8 changes: 4 additions & 4 deletions test/node_flows_spec.js → test/red/nodes/flows_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
22 changes: 22 additions & 0 deletions test/red/nodes/index_spec.js
Original file line number Diff line number Diff line change
@@ -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");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
22 changes: 22 additions & 0 deletions test/red/red_spec.js
Original file line number Diff line number Diff line change
@@ -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 changes: 22 additions & 0 deletions test/red/server_spec.js
Original file line number Diff line number Diff line change
@@ -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");
});
});
24 changes: 24 additions & 0 deletions test/red/storage/index_spec.js
Original file line number Diff line number Diff line change
@@ -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");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
22 changes: 22 additions & 0 deletions test/red/ui_spec.js
Original file line number Diff line number Diff line change
@@ -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");
});
});

0 comments on commit 8f3de41

Please sign in to comment.