0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

fixing tests

This commit is contained in:
Alex Kocharin 2013-12-12 02:01:23 +04:00
parent 96b336acc3
commit 942a7747ac
5 changed files with 23 additions and 22 deletions

View file

@ -109,3 +109,12 @@ ex['downloading package via server2'] = function(cb) {
cb();
});
};
ex['publishing package / bad ro uplink'] = function(cb) {
server.put_package('baduplink', require('./lib/package')('baduplink'), function(res, body) {
assert.equal(res.statusCode, 503);
assert(~body.error.indexOf('one of the uplinks is down, refuse to publish'));
cb();
});
}

View file

@ -9,6 +9,8 @@ uplinks:
url: http://localhost:55550/
server2:
url: http://localhost:55552/
baduplink:
url: http://localhost:55666/
logs:
- {type: stdout, format: pretty, level: trace}
@ -31,6 +33,11 @@ packages:
allow_publish: all
proxy_access: express
'baduplink':
allow_access: all
allow_publish: all
proxy_access: baduplink
'*':
allow_access: test undefined
allow_publish: test undefined

View file

@ -8,6 +8,9 @@ uplinks:
server1:
url: http://localhost:55551/
logs:
- {type: stdout, format: pretty, level: trace}
packages:
'testfwd':
allow_access: all

View file

@ -1,21 +0,0 @@
#!/usr/bin/env node
var Server = require('./lib/server')
, forks = process.forks = []
, server = process.server = new Server('http://localhost:55551/')
, server2 = process.server2 = new Server('http://localhost:55552/')
process.on('exit', function() {
if (forks[0]) forks[0].kill()
if (forks[1]) forks[1].kill()
})
var repl = require('repl').start({
prompt: "> ",
input: process.stdin,
output: process.stdout,
})
repl.context.server = server
repl.context.server2 = server2

View file

@ -12,7 +12,10 @@ ex['starting servers'] = function(cb) {
function start(dir, conf) {
count++;
rimraf(dir, function() {
var f = fork('../bin/sinopia', ['-c', conf], {silent: true});
var f = fork('../bin/sinopia'
, ['-c', conf]
, {silent: true}
);
forks.push(f);
f.on('message', function(msg) {
if ('sinopia_started' in msg) {