-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cnpm install error without user settings (#301)
- Loading branch information
Showing
3 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
registry=https://registry.npmjs.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
const rimraf = require('rimraf'); | ||
const coffee = require('coffee'); | ||
const npminstall = path.join(__dirname, '..', 'bin', 'install.js'); | ||
|
||
const cwd = path.join(__dirname, './fixtures/initial-cnpmrc/'); | ||
|
||
describe('test/install-without-userconfig.test.js', () => { | ||
it('should run cnpm install successfully without cnpmrc userconfig', function* () { | ||
function cleanup() { | ||
rimraf.sync(path.join(cwd, 'node_modules')); | ||
} | ||
|
||
beforeEach(cleanup); | ||
afterEach(cleanup); | ||
|
||
yield coffee.fork(npminstall, ['webpack-parallel-uglify-plugin@1.0.0'], { | ||
cwd: cwd, | ||
env: Object.assign({}, process.env, { | ||
USERPROFILE: cwd, | ||
HOME: cwd | ||
}) | ||
}) | ||
.debug() | ||
.expect('code', 0) | ||
.end(); | ||
}); | ||
}); |