Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

help-me-test

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

help-me-test - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

18

lib/index.js

@@ -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 @@ */

2

package.json
{
"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();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc