Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f225459

Browse filesBrowse files
santigimenorvagg
authored andcommitted
test: improve test-npm-install
Make npm install a dependency that is defined as a relative path, so it avoids any network interaction. PR-URL: #5613 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
1 parent cceae5a commit f225459
Copy full SHA for f225459

File tree

Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-npm-install.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-npm-install.js
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ const args = [
2222
'install'
2323
];
2424

25-
const pkgContent = '{}';
25+
const pkgContent = JSON.stringify({
26+
dependencies: {
27+
'package-name': common.fixturesDir + '/packages/main'
28+
}
29+
});
2630

2731
const pkgPath = path.join(common.tmpDir, 'package.json');
2832

@@ -35,6 +39,9 @@ const proc = spawn(process.execPath, args, {
3539
function handleExit(code, signalCode) {
3640
assert.equal(code, 0, 'npm install should run without an error');
3741
assert.ok(signalCode === null, 'signalCode should be null');
42+
assert.doesNotThrow(function() {
43+
fs.accessSync(common.tmpDir + '/node_modules/package-name');
44+
});
3845
}
3946

4047
proc.on('exit', common.mustCall(handleExit));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.