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

this

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

this - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

test/helpers/package/index.js

2

package.json
{
"name": "this",
"version": "1.0.1",
"version": "1.0.2",
"description": "Traverses up the directory tree and returns the first module found",

@@ -5,0 +5,0 @@ "main": "src/index.js",

import test from 'ava';
test(`importing doesn't throw`, t => {
t.notThrows(() => require('../'));
const cwd = process.cwd();
const pkgPath = require.resolve('../');
test.afterEach.always(() => {
process.chdir(cwd);
delete require.cache[pkgPath];
});
test.serial(`exports root module`, t => {
process.chdir('test/helpers/package');
t.is(require(pkgPath), 'package');
});
test.serial(`exports undfined if there's no root module`, t => {
process.chdir('/');
t.is(require(pkgPath), undefined);
});
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