Skip to content

Commit

Permalink
Use localhost as proxy target in test to avoid appveyor node 6 EADDRN…
Browse files Browse the repository at this point in the history
…OTAVAIL issue
  • Loading branch information
rlamana committed Mar 5, 2019
1 parent d971283 commit 9eb19e1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/Client.test.js
Expand Up @@ -13,7 +13,7 @@ function startProxy(port) {
proxy.use(
'/',
httpProxy({
target: 'http://0.0.0.0:8080',
target: 'http://localhost:8080',
ws: true,
changeOrigin: true,
})
Expand Down Expand Up @@ -45,15 +45,15 @@ describe('Client code', () => {
jest.setTimeout(30000);

beforeAll(() => {
proxy = startProxy(9050);
proxy = startProxy(9000);
});

afterAll(() => {
proxy.close();
});

it('responds with a 200', (done) => {
const req = request('http://localhost:9050');
const req = request('http://localhost:9000');
req.get('/sockjs-node').expect(200, 'Welcome to SockJS!\n', done);
});

Expand All @@ -63,12 +63,12 @@ describe('Client code', () => {
.waitForRequest((requestObj) => requestObj.url().match(/sockjs-node/))
.then((requestObj) => {
expect(requestObj.url()).toMatch(
/^http:\/\/localhost:9050\/sockjs-node/
/^http:\/\/localhost:9000\/sockjs-node/
);
browser.close();
done();
});
page.goto('http://localhost:9050/main');
page.goto('http://localhost:9000/main');
});
});
});
Expand Down

0 comments on commit 9eb19e1

Please sign in to comment.