1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-17 07:45:52 +01:00
verdaccio/test/functional/readme/readme.spec.js

40 lines
902 B
JavaScript
Raw Normal View History

2017-12-02 11:19:08 +01:00
import assert from 'assert';
2017-12-02 11:19:08 +01:00
export default function (server, server2) {
describe('should test readme', () => {
2017-12-02 11:19:08 +01:00
beforeAll(function() {
return server.request({
uri: '/readme-test',
headers: {
'content-type': 'application/json',
},
method: 'PUT',
json: require('./pkg-readme.json'),
}).status(201);
});
2017-12-02 11:19:08 +01:00
test('add pkg', () => {});
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 11:19:08 +01:00
test('server1 - readme', () => {
return matchReadme(server);
});
2017-12-02 11:19:08 +01:00
test('server2 - readme', () => {
return matchReadme(server2);
});
});
});
2017-12-02 11:19:08 +01:00
}