2017-12-02 11:19:08 +01:00
|
|
|
import assert from 'assert';
|
2018-04-30 15:41:04 +02:00
|
|
|
import {HEADERS} from '../../../src/lib/constants';
|
2017-07-24 23:09:28 +02:00
|
|
|
|
2017-12-02 11:19:08 +01:00
|
|
|
export default function (server, server2) {
|
2017-07-24 23:09:28 +02:00
|
|
|
|
|
|
|
describe('should test readme', () => {
|
|
|
|
|
2017-12-02 11:19:08 +01:00
|
|
|
beforeAll(function() {
|
2017-07-24 23:09:28 +02:00
|
|
|
return server.request({
|
|
|
|
uri: '/readme-test',
|
|
|
|
headers: {
|
2018-04-30 15:41:04 +02:00
|
|
|
'content-type': HEADERS.JSON,
|
2017-07-24 23:09:28 +02:00
|
|
|
},
|
|
|
|
method: 'PUT',
|
|
|
|
json: require('./pkg-readme.json'),
|
|
|
|
}).status(201);
|
|
|
|
});
|
|
|
|
|
2017-12-02 11:19:08 +01:00
|
|
|
test('add pkg', () => {});
|
2017-07-24 23:09:28 +02:00
|
|
|
|
|
|
|
describe('should check readme file', () => {
|
2018-01-28 02:40:07 +01:00
|
|
|
const matchReadme = (serverRef) => {
|
|
|
|
return serverRef.request({
|
2017-07-24 23:09:28 +02:00
|
|
|
uri: '/-/verdaccio/package/readme/readme-test'
|
|
|
|
}).status(200).then(function(body) {
|
|
|
|
assert.equal(body, '<p>this is a readme</p>\n');
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2017-12-02 11:19:08 +01:00
|
|
|
test('server1 - readme', () => {
|
2017-07-24 23:09:28 +02:00
|
|
|
return matchReadme(server);
|
|
|
|
});
|
|
|
|
|
2017-12-02 11:19:08 +01:00
|
|
|
test('server2 - readme', () => {
|
2017-07-24 23:09:28 +02:00
|
|
|
return matchReadme(server2);
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
2017-12-02 11:19:08 +01:00
|
|
|
}
|