2017-12-02 05:19:08 -05:00
|
|
|
import assert from 'assert';
|
2017-07-24 16:09:28 -05:00
|
|
|
|
2017-12-02 05:19:08 -05:00
|
|
|
export default function (server, server2) {
|
2017-07-24 16:09:28 -05:00
|
|
|
|
|
|
|
describe('should test readme', () => {
|
|
|
|
|
2017-12-02 05:19:08 -05:00
|
|
|
beforeAll(function() {
|
2017-07-24 16:09:28 -05:00
|
|
|
return server.request({
|
|
|
|
uri: '/readme-test',
|
|
|
|
headers: {
|
|
|
|
'content-type': 'application/json',
|
|
|
|
},
|
|
|
|
method: 'PUT',
|
|
|
|
json: require('./pkg-readme.json'),
|
|
|
|
}).status(201);
|
|
|
|
});
|
|
|
|
|
2017-12-02 05:19:08 -05:00
|
|
|
test('add pkg', () => {});
|
2017-07-24 16:09:28 -05:00
|
|
|
|
|
|
|
describe('should check readme file', () => {
|
|
|
|
const matchReadme = (server) => {
|
|
|
|
return server.request({
|
|
|
|
uri: '/-/verdaccio/package/readme/readme-test'
|
|
|
|
}).status(200).then(function(body) {
|
|
|
|
assert.equal(body, '<p>this is a readme</p>\n');
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2017-12-02 05:19:08 -05:00
|
|
|
test('server1 - readme', () => {
|
2017-07-24 16:09:28 -05:00
|
|
|
return matchReadme(server);
|
|
|
|
});
|
|
|
|
|
2017-12-02 05:19:08 -05:00
|
|
|
test('server2 - readme', () => {
|
2017-07-24 16:09:28 -05:00
|
|
|
return matchReadme(server2);
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
2017-12-02 05:19:08 -05:00
|
|
|
}
|