0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-20 22:52:46 -05:00

Merge pull request #642 from verdaccio/feat-htpasswd

chore(deps): update verdaccio-htpasswd plugin
This commit is contained in:
Juan Picado @jotadeveloper 2018-04-03 21:29:29 +02:00 committed by GitHub
commit 58162f9ef3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 810 additions and 672 deletions

View file

@ -45,7 +45,7 @@
"pkginfo": "0.4.1",
"request": "2.83.0",
"semver": "5.5.0",
"verdaccio-htpasswd": "^0.1.4"
"verdaccio-htpasswd": "0.2.0"
},
"devDependencies": {
"@commitlint/cli": "6.1.3",

View file

@ -146,12 +146,14 @@ describe('endpoint unit test', () => {
});
test('should test add a new user with login', (done) => {
const newCredentials = _.clone(credentials);
newCredentials.name = 'jotaNew';
request(app)
.put('/-/user/org.couchdb.user:jota')
.send(credentials)
.put('/-/user/org.couchdb.user:jotaNew')
.send(newCredentials)
.expect('Content-Type', /json/)
.expect(200)
.expect(201)
.end(function(err, res) {
if (err) {
return done(err);
@ -161,6 +163,22 @@ describe('endpoint unit test', () => {
});
});
test('should test fails on add a existing user with login', (done) => {
request(app)
.put('/-/user/org.couchdb.user:jotaNew')
.send(credentials)
.expect('Content-Type', /json/)
.expect(409)
.end(function(err, res) {
if (err) {
return done(err);
}
expect(res.body.error).toBeDefined();
expect(res.body.error).toMatch(/username is already registered/);
done();
});
});
test('should test fails add a new user with wrong password', (done) => {
const credentialsShort = _.clone(credentials);

1456
yarn.lock

File diff suppressed because it is too large Load diff