Skip to content

Commit

Permalink
[TIMOB-11869] Added __lib() function that helps choose the lib or lib…
Browse files Browse the repository at this point in the history
…-cov dir.
  • Loading branch information
cb1kenobi committed Jul 9, 2013
1 parent cc6b571 commit 27cd4d6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .gitignore
@@ -1,4 +1,6 @@
._*
.DS_Store
npm-debug.log
node_modules
node_modules
lib-cov
coverage.html
9 changes: 6 additions & 3 deletions .npmignore
@@ -1,8 +1,11 @@
.DS_Store
.git*
docs
node_modules
test
tools
*.sublime-project
*.sublime-workspace
docs
tests
lib-cov
coverage.html
forge
forge-tools
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -40,6 +40,7 @@
"colors": "~0.6.0",
"fields": "~0.1.x",
"humanize": "~0.0.7",
"jade": "~0.31.2",
"longjohn": "~0.2.0",
"moment": "~2.0.0",
"node-appc": "~0.2.0",
Expand Down
12 changes: 10 additions & 2 deletions tests/run.js
Expand Up @@ -13,8 +13,8 @@ var fs = require('fs'),
path = require('path'),
colors = require('colors'),
should = require('should'),
Mocha = require(__dirname + '/../node_modules/mocha/lib/mocha.js'),
Base = require(__dirname + '/../node_modules/mocha/lib/reporters/base'),
Mocha = require('../node_modules/mocha/lib/mocha.js'),
Base = require('../node_modules/mocha/lib/reporters/base'),
mocha = new Mocha,
optimist = require('optimist'),
reporter = 'spec';
Expand Down Expand Up @@ -69,8 +69,16 @@ if (confFile) {
}
}

global.__lib = function (file) {
return path.join(__dirname, '..', 'lib', file);
};

// if we're running coverage testing, then we need to use our custom reporter
if (process.env.APPC_COV) {
global.__lib = function (file) {
return path.join(__dirname, '..', 'lib-cov', file);
};

reporter = function (runner) {
var jade = require('jade'),
JSONCov = require(__dirname + '/../node_modules/mocha/lib/reporters/json-cov'),
Expand Down
2 changes: 1 addition & 1 deletion tests/test-hook.js
Expand Up @@ -7,7 +7,7 @@

var assert = require('assert'),
path = require('path'),
hook = require('../lib/hook');
hook = require(__lib('hook'));

describe('hook', function () {
it('namespace exists', function () {
Expand Down

0 comments on commit 27cd4d6

Please sign in to comment.