parse-app-info
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -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 @@ }; |
{ | ||
"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'); | ||
}); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
9158
10
117
0
19