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
Juan Picado 558fcafc71
build: format code prettier, enable ci (#2886)
* fix: format code prettier, enable ci

* chore: add trivago import prettier pluggin
2022-01-09 20:51:50 +01:00

28 lines
804 B
JavaScript

import { API_ERROR, HTTP_STATUS } from '../../../src/lib/constants';
export default function (server) {
describe('npm adduser', () => {
const user = String(Math.random());
const pass = String(Math.random());
beforeAll(function () {
return server
.auth(user, pass)
.status(HTTP_STATUS.CREATED)
.body_ok(/user .* created/);
});
test('should create new user', () => {});
test('should log in', () => {
return server
.auth(user, pass)
.status(HTTP_STATUS.CREATED)
.body_ok(/you are authenticated as/);
});
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);
});
});
}