Skip to content

Commit

Permalink
Merge pull request #122 from pladaria/devel
Browse files Browse the repository at this point in the history
Stabilize tests
  • Loading branch information
pladaria authored Jan 31, 2020
2 parents 12c275f + 9160e21 commit 55d5354
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"rollup-plugin-typescript2": "^0.23.0",
"tslib": "^1.10.0",
"tslint": "^5.19.0",
"typescript": "^3.5.3",
"typescript": "^3.7.5",
"uglify-es": "^3.3.10",
"ws": "^6.2.1"
},
Expand Down
12 changes: 6 additions & 6 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ test.cb('connect, send, receive, reconnect', t => {
});

test.cb('immediately-failed connection should not timeout', t => {
const ws = new ReconnectingWebSocket('ws://thiswillfail.com', null, {
const ws = new ReconnectingWebSocket('ws://255.255.255.255', null, {
maxRetries: 2,
connectionTimeout: 500,
});
Expand All @@ -570,7 +570,7 @@ test.cb('immediately-failed connection should not timeout', t => {
t.fail();
}
if (ws.retryCount === 2) {
setTimeout(() => t.end(), 1500);
setTimeout(() => t.end(), 500);
}
if (ws.retryCount > 2) {
t.fail();
Expand All @@ -579,9 +579,9 @@ test.cb('immediately-failed connection should not timeout', t => {
});

test.cb('immediately-failed connection with 0 maxRetries must not retry', t => {
const ws = new ReconnectingWebSocket('ws://thiswillfail.com', [], {
const ws = new ReconnectingWebSocket('ws://255.255.255.255', [], {
maxRetries: 0,
connectionTimeout: 500,
connectionTimeout: 2000,
minReconnectionDelay: 100,
maxReconnectionDelay: 200,
});
Expand All @@ -597,7 +597,7 @@ test.cb('immediately-failed connection with 0 maxRetries must not retry', t => {
}
setTimeout(() => {
t.end();
}, 500);
}, 2100);
});
});

Expand Down Expand Up @@ -771,7 +771,7 @@ test.cb('closing from the other side should allow to keep closed', t => {
});

test.cb('reconnection delay grow factor', t => {
const ws = new ReconnectingWebSocket('wss://bad.url', [], {
const ws = new ReconnectingWebSocket('wss://255.255.255.255', [], {
minReconnectionDelay: 100,
maxReconnectionDelay: 1000,
reconnectionDelayGrowFactor: 2,
Expand Down

0 comments on commit 55d5354

Please sign in to comment.