Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Commit

Permalink
Create test for installing dependencies using custom servers
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyworboys authored and tj committed Jan 17, 2013
1 parent aa7c059 commit f2c74d3
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/remotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ describe('component install from remote', function(){
}), done);
})

before(function(done){
mkdir('test/private-registry/testdependencies/master', done);
})

before(function(done){
fs.writeFile('test/private-registry/testdependencies/master/component.json', JSON.stringify({
name: 'testdependencies',
repo: 'private-registry/testdependencies',
remotes: ['http://localhost:3000'],
dependencies: {'private-registry/testcomponent': "*"}
}), done);
})

before(function(done){
app.use(express.static(__dirname));
app.listen(3000, done);
Expand Down Expand Up @@ -63,6 +76,22 @@ describe('component install from remote', function(){
done();
})
})

it('should install private dependencies', function(done){
exec('bin/component install private-registry/testdependencies', function(err, stdout, stderr){
if (err) return done(err);
stdout.should.include('install');
stdout.should.include('dep');
stdout.should.include('complete');
var json = require(path.resolve('components/private-registry-testdependencies/component.json'));
json.name.should.equal('testdependencies');
json.repo.should.equal('private-registry/testdependencies');
json = require(path.resolve('components/private-registry-testcomponent/component.json'));
json.name.should.equal('testcomponent');
json.repo.should.equal('private-registry/testcomponent');
done();
})
})
})

describe('with authentication', function(){
Expand Down

0 comments on commit f2c74d3

Please sign in to comment.