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

parse-app-info

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-app-info - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

test/env.test.js

5

index.js

@@ -17,3 +17,2 @@ const readPkgUp = require('read-pkg-up');

};
/* istanbul ignore if */
if (gitTag) {

@@ -62,4 +61,4 @@ result.tag = gitTag;

...lastCommit,
environment: /* istanbul ignore next */ NODE_ENV || 'development',
hostname: /* istanbul ignore next */ HOSTNAME || require('os').hostname(),
environment: NODE_ENV || 'development',
hostname: HOSTNAME || require('os').hostname(),
pid: process.pid

@@ -66,0 +65,0 @@ };

6

package.json
{
"name": "parse-app-info",
"description": "parse information about an application process",
"version": "1.0.1",
"version": "1.0.2",
"author": "Philipp Kursawe <phil.kursawe@gmail.com> (https://pke.github.io)",

@@ -29,3 +29,3 @@ "ava": {

"@commitlint/config-conventional": "latest",
"ava": "latest",
"ava": "1.0.0-beta.8",
"codecov": "latest",

@@ -40,2 +40,3 @@ "cross-env": "latest",

"lint-staged": "latest",
"mocked-env": "1.2.1",
"nyc": "latest",

@@ -45,2 +46,3 @@ "prettier": "latest",

"remark-preset-github": "latest",
"testdouble": "3.8.1",
"xo": "latest"

@@ -47,0 +49,0 @@ },

const test = require('ava');
const td = require('testdouble');
const parseAppInfo = require('..');
test.beforeEach(t => {
t.context.LastCommitLog = td.replace('last-commit-log');
t.context.parseAppInfo = require('..');
});
test.afterEach(() => {
td.reset();
});
test('does not include missing git info', async t => {
td.when(t.context.LastCommitLog.prototype.getLastCommit()).thenReject();
const appInfo = await t.context.parseAppInfo();
t.is(appInfo.hash, undefined);
t.is(appInfo.tag, undefined);
});
test('does not include missing git tag', async t => {
td.when(t.context.LastCommitLog.prototype.getLastCommit()).thenResolve({
hash: 0xdeadbeadd00de
});
const appInfo = await t.context.parseAppInfo();
t.is(appInfo.hash, 0xdeadbeadd00de);
t.is(appInfo.tag, undefined);
});
test('returns this packages info', async t => {
const appInfo = await parseAppInfo();
td.when(t.context.LastCommitLog.prototype.getLastCommit()).thenResolve({
hash: 0xdeadbeadd00de,
gitTag: '1.0.2'
});
const appInfo = await t.context.parseAppInfo();
t.is(appInfo.node, process.version);

@@ -12,2 +40,4 @@ t.is(appInfo.environment, 'test');

t.is(appInfo.name, 'parse-app-info');
t.is(appInfo.hash, 0xdeadbeadd00de);
t.is(appInfo.tag, '1.0.2');
});
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