[Pkg-javascript-commits] [sockjs-client] 79/350: Add larger timeout for sauce connect tests
tonnerre at ancient-solutions.com
tonnerre at ancient-solutions.com
Fri Aug 5 01:03:44 UTC 2016
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.
commit 7536eda08cd44ac2a6a954df743327238863627c
Author: Bryce Kahle <bkahle at gmail.com>
Date: Thu Aug 21 11:59:45 2014 -0400
Add larger timeout for sauce connect tests
---
.travis.yml | 4 ++++
package.json | 3 ++-
tests/html/lib/endtoendtests.js | 6 ++++++
tests/sockjs_server.js | 8 +++++---
4 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 0907c7f..6ef9762 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,6 +3,10 @@ node_js:
- '0.10'
before_script:
- "gulp test"
+script:
+ - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && npm test || false'
+addons:
+ sauce_connect: true
env:
global:
- secure: L36j3mbU1U2FiOhxYZrTZ7apVnb56gE+QFixsYyDpCRBrVW0q8WR9LTMJx+aPNdlzhRS5FT4gfInujPTnZeb+EvqEoYwtT+CeNG15XtGkfJDkfBFjBa4IZpJAjIwJB+0kKkZr9R7lQEEgy7H9FvLHY2N2WgdzuG8WZwiVRnkwVw=
diff --git a/package.json b/package.json
index df0ca55..a99bac5 100644
--- a/package.json
+++ b/package.json
@@ -39,7 +39,8 @@
"url": "https://github.com/sockjs/sockjs-client.git"
},
"scripts": {
- "test": "./node_modules/zuul/bin/zuul -- tests/html/lib/unittests.js tests/html/lib/domtests.js tests/html/lib/endtoendtests.js tests/html/lib/tests.js",
+ "test": "./node_modules/zuul/bin/zuul --sauce-connect -- tests/html/lib/unittests.js tests/html/lib/domtests.js tests/html/lib/endtoendtests.js tests/html/lib/tests.js",
+ "test_ws": "./node_modules/zuul/bin/zuul --sauce-connect -- tests/html/lib/ws_test.js",
"test_local": "./node_modules/zuul/bin/zuul --local 9090 -- tests/html/lib/unittests.js tests/html/lib/domtests.js tests/html/lib/endtoendtests.js tests/html/lib/tests.js"
}
}
diff --git a/tests/html/lib/endtoendtests.js b/tests/html/lib/endtoendtests.js
index 1717a98..95caca0 100644
--- a/tests/html/lib/endtoendtests.js
+++ b/tests/html/lib/endtoendtests.js
@@ -5,11 +5,14 @@ var assert = require('assert');
var u = require('../../../lib/utils');
var testutils = require('./testutils');
+var TIMEOUT_MS = 10000;
+
suite('End to End');
suite('Connection Errors');
test("invalid url 404", function(done) {
+ this.timeout(TIMEOUT_MS);
this.runnable().globals(['_sockjs_global']);
var r;
//expect(4);
@@ -35,6 +38,7 @@ test("invalid url 404", function(done) {
});
test("invalid url port", function(done) {
+ this.timeout(TIMEOUT_MS);
this.runnable().globals(['_sockjs_global']);
var dl, r;
//expect(4);
@@ -58,6 +62,7 @@ test("invalid url port", function(done) {
});
test("disabled websocket test", function(done) {
+ this.timeout(TIMEOUT_MS);
this.runnable().globals(['_sockjs_global']);
var r;
//expect(3);
@@ -77,6 +82,7 @@ test("disabled websocket test", function(done) {
});
test("close on close", function(done) {
+ this.timeout(TIMEOUT_MS);
this.runnable().globals(['_sockjs_global', '_jp']);
var r;
//expect(4);
diff --git a/tests/sockjs_server.js b/tests/sockjs_server.js
index 801514c..7348e7e 100644
--- a/tests/sockjs_server.js
+++ b/tests/sockjs_server.js
@@ -41,8 +41,10 @@ server.addListener('request', function(req, res) {
res.writeHead(200);
res.end(new Array(2049).join('a') + '\nb\n');
} else if (req.url === '/config.js') {
- var parsedOrigin = url.parse(req.headers.referer || 'http://localhost');
- client_opts.url = parsedOrigin.protocol + '//' + parsedOrigin.hostname + ':' + port;
+ if (req.headers.referer) {
+ var parsedOrigin = url.parse(req.headers.referer);
+ client_opts.url = parsedOrigin.protocol + '//' + parsedOrigin.hostname + ':' + port;
+ }
res.setHeader('content-type', 'application/javascript');
res.writeHead(200);
res.end('var client_opts = ' +
@@ -65,4 +67,4 @@ sockjs_app.install({
}, server);
console.log(" [*] Listening on", port);
-server.listen(port);
+server.listen(port);
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git
More information about the Pkg-javascript-commits
mailing list