Skip to content

Commit 5b82539

Browse files
remove minimal-request from acceptance-tests
1 parent 608c188 commit 5b82539

File tree

3 files changed

+186
-301
lines changed

3 files changed

+186
-301
lines changed

test/acceptance/registry-ui.js

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@
33
const expect = require('chai').expect;
44
const oc = require('../../dist/index');
55
const path = require('path');
6-
const request = require('minimal-request');
6+
const got = require('got');
77

88
describe('registry (ui interface)', () => {
99
let registry;
1010
let result;
1111
let error;
1212
let headers;
1313

14-
const next = done => (e, r, d) => {
15-
error = e;
16-
result = r;
17-
headers = d.response.headers;
18-
done();
14+
const next = (promise, done) => {
15+
promise
16+
.then(r => {
17+
headers = r.headers;
18+
result = r.body;
19+
})
20+
.catch(e => (error = e))
21+
.finally(done);
1922
};
2023

2124
const conf = {
@@ -40,17 +43,16 @@ describe('registry (ui interface)', () => {
4043

4144
describe('GET / with Accept: text/html', () => {
4245
before(done => {
43-
request(
44-
{
45-
url: 'http://localhost:3030',
46+
next(
47+
got('http://localhost:3030', {
4648
headers: { accept: 'text/html' }
47-
},
48-
next(done)
49+
}),
50+
done
4951
);
5052
});
5153

5254
it('should not error', () => {
53-
expect(error).to.be.null;
55+
expect(error).to.be.undefined;
5456
});
5557

5658
it('should respond with html result', () => {
@@ -61,17 +63,16 @@ describe('registry (ui interface)', () => {
6163

6264
describe('GET /oc-client/~info with Accept: text/html', () => {
6365
before(done => {
64-
request(
65-
{
66-
url: 'http://localhost:3030/oc-client/~info',
66+
next(
67+
got('http://localhost:3030/oc-client/~info', {
6768
headers: { accept: 'text/html' }
68-
},
69-
next(done)
69+
}),
70+
done
7071
);
7172
});
7273

7374
it('should not error', () => {
74-
expect(error).to.be.null;
75+
expect(error).to.be.undefined;
7576
});
7677

7778
it('should respond with html result', () => {

0 commit comments

Comments
 (0)