mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
test: Add functional test to un publish a single version
This commit is contained in:
parent
442305c62f
commit
6f006fbf40
2 changed files with 33 additions and 0 deletions
|
@ -30,6 +30,10 @@ module.exports = function() {
|
|||
return server.addPackage('testpkg');
|
||||
});
|
||||
|
||||
before(function() {
|
||||
return server.addPackage('testpkg-single-tarball');
|
||||
});
|
||||
|
||||
it('creating new package', function() {/* test for before() */});
|
||||
|
||||
it('downloading non-existent tarball', function() {
|
||||
|
@ -48,6 +52,12 @@ module.exports = function() {
|
|||
.body_ok(/.*/);
|
||||
});
|
||||
|
||||
before(function() {
|
||||
return server.putTarball('testpkg-single-tarball', 'single', readfile('fixtures/binary'))
|
||||
.status(201)
|
||||
.body_ok(/.*/);
|
||||
});
|
||||
|
||||
after(function() {
|
||||
return server.removeTarball('testpkg').status(201);
|
||||
});
|
||||
|
@ -64,6 +74,18 @@ module.exports = function() {
|
|||
return server.removeTarball('testpkg404').status(404);
|
||||
});
|
||||
|
||||
it('remove non existing single tarball', function() {
|
||||
return server.removeSingleTarball('', 'fakeFile').status(404);
|
||||
});
|
||||
|
||||
// testexp-incomplete
|
||||
|
||||
it('remove existing single tarball', function() {
|
||||
return server.removeSingleTarball('testpkg-single-tarball', 'single').status(201);
|
||||
});
|
||||
|
||||
// testexp-incomplete
|
||||
|
||||
it('downloading newly created tarball', function() {
|
||||
return server.getTarball('testpkg', 'blahblah')
|
||||
.status(200)
|
||||
|
|
|
@ -118,6 +118,17 @@ class Server {
|
|||
});
|
||||
}
|
||||
|
||||
removeSingleTarball(name, filename) {
|
||||
return this.request({
|
||||
uri: `/${encodeURIComponent(name)}/-/${filename}/-rev/whatever`,
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'content-type': 'application/json; charset=utf-8',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
addTag(name, tag, version) {
|
||||
return this.request({
|
||||
uri: `/${encodeURIComponent(name)}/${encodeURIComponent(tag)}`,
|
||||
|
|
Loading…
Reference in a new issue