0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/test/functional/adduser/adduser.js

29 lines
842 B
JavaScript
Raw Normal View History

import {API_ERROR, HTTP_STATUS} from "../../../src/lib/constants";
2017-12-02 05:19:08 -05:00
export default function(server) {
describe('npm adduser', () => {
2017-04-19 14:15:28 -05:00
const user = String(Math.random());
const pass = String(Math.random());
2017-12-02 05:19:08 -05:00
beforeAll(function() {
return server.auth(user, pass)
.status(HTTP_STATUS.CREATED)
2017-04-19 14:15:28 -05:00
.body_ok(/user .* created/);
});
2014-07-22 16:45:28 -05:00
2017-12-02 05:19:08 -05:00
test('should create new user', () => {});
2014-07-22 16:45:28 -05:00
2017-12-02 05:19:08 -05:00
test('should log in', () => {
return server.auth(user, pass)
.status(HTTP_STATUS.CREATED)
2017-04-19 14:15:28 -05:00
.body_ok(/you are authenticated as/);
});
2014-07-22 16:45:28 -05:00
2017-12-02 05:19:08 -05:00
test('should not register more users', () => {
return server.auth(String(Math.random()), String(Math.random()))
.status(HTTP_STATUS.CONFLICT)
.body_error(API_ERROR.MAX_USERS_REACHED);
2017-04-19 14:15:28 -05:00
});
});
2017-12-02 05:19:08 -05:00
}