help-me-test
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -38,3 +38,21 @@ var path = require('path'); | ||
/** | ||
* @property {string} root project directory | ||
* @default | ||
*/ | ||
projectRoot: path.resolve(testRoot, '..'), | ||
/** | ||
* Require lib module to test | ||
* @param {string} modulePath - path to module, relative to project root directory | ||
*/ | ||
module: function () { | ||
var args = Array.prototype.slice.call(arguments, 0); | ||
args.unshift(this.projectRoot); | ||
return require(path.resolve.apply(path, args)); | ||
}, | ||
/** | ||
* Require lib module to test | ||
* @param {string} modulePath - path to module, relative to project lib directory | ||
@@ -41,0 +59,0 @@ */ |
{ | ||
"name": "help-me-test", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"author": "Seth McLaughlin", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -5,3 +5,3 @@ var index = require('../../../lib'); | ||
describe('Help Me Test', function () { | ||
describe('help-me-test', function () { | ||
var h; | ||
@@ -50,7 +50,18 @@ | ||
describe('lib()', function () { | ||
describe('#module()', function () { | ||
beforeEach(function () { | ||
h.testRoot = path.resolve(__dirname, '..', '..', 'fixtures', 'fake_test_root'); | ||
h.projectRoot = path.resolve(h.testRoot, '..'); | ||
}); | ||
it('should have the correct path', function () { | ||
assert.strictEqual(h.module('lib', 'one'), 1); | ||
}); | ||
}); | ||
describe('#lib()', function () { | ||
beforeEach(function () { | ||
h.testRoot = path.resolve(__dirname, '..', '..', 'fixtures', 'fake_test_root'); | ||
}); | ||
it('should require the correct child module', function () { | ||
@@ -65,3 +76,3 @@ assert.strictEqual(h.lib('one'), 1); | ||
describe('proxy()', function () { | ||
describe('#proxy()', function () { | ||
beforeEach(function () { | ||
@@ -85,3 +96,3 @@ h.testRoot = path.resolve(__dirname, '..', '..', 'fixtures', 'fake_test_root'); | ||
describe('mock()', function () { | ||
describe('#mock()', function () { | ||
it('should require the correct child module', function () { | ||
@@ -96,3 +107,3 @@ assert.strictEqual(h.mock('mock'), 333); | ||
describe('fixture()', function () { | ||
describe('#fixture()', function () { | ||
it('should read the correct child file', function () { | ||
@@ -107,3 +118,3 @@ assert.strictEqual(h.fixture('foo.sh'), 'abracadabra\n'); | ||
describe('path()', function () { | ||
describe('#path()', function () { | ||
it('should build the correct path', function () { | ||
@@ -114,3 +125,3 @@ assert.equal(h.path('foo'), path.resolve(__dirname, '..', '..', 'foo')); | ||
describe('assert', function () { | ||
describe('#assert()', function () { | ||
it('should be a function', function () { | ||
@@ -121,3 +132,3 @@ assert.equal(typeof h.assert, 'function'); | ||
describe('spy', function () { | ||
describe('#spy()', function () { | ||
it('should be a functional sinon spy', function () { | ||
@@ -124,0 +135,0 @@ var spy = h.spy(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14000
422
0
8