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:
commit
58162f9ef3
3 changed files with 810 additions and 672 deletions
|
@ -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",
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue