[Pkg-javascript-commits] [sockjs-client] 59/350: Allow tests to be run without zuul. Fix origin tests

tonnerre at ancient-solutions.com tonnerre at ancient-solutions.com
Fri Aug 5 01:03:42 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 93d45c7cfe18801e7bd3149fcd08818f30c830c1
Author: Bryce Kahle <bkahle at gmail.com>
Date:   Wed May 28 11:08:09 2014 -0400

    Allow tests to be run without zuul. Fix origin tests
---
 .gitignore                  |  1 +
 gulpfile.js                 |  8 +++++++-
 tests/html/lib/alltests.js  |  5 +++++
 tests/html/lib/unittests.js | 12 +++++++-----
 tests/html/tests-qunit.html |  5 +----
 5 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/.gitignore b/.gitignore
index cd08623..1f62a93 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@ sockjs.min.js
 .testling_env.sh
 testling.js
 build/
+tests/html/lib/alltestsbundle.js
diff --git a/gulpfile.js b/gulpfile.js
index 5746ed4..c7aaa53 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -27,7 +27,13 @@ gulp.task('default', function() {
 });
 
 gulp.task('test', function() {
-  return debugBuild()
+  debugBuild()
+    .pipe(gulp.dest('./tests/html/lib/'))
+    ;
+
+  browserify('./tests/html/lib/alltests.js')
+    .bundle()
+    .pipe(source('alltestsbundle.js'))
     .pipe(gulp.dest('./tests/html/lib/'))
     ;
 });
diff --git a/tests/html/lib/alltests.js b/tests/html/lib/alltests.js
new file mode 100644
index 0000000..9c9c429
--- /dev/null
+++ b/tests/html/lib/alltests.js
@@ -0,0 +1,5 @@
+'use strict';
+require('./unittests');
+require('./domtests');
+require('./endtoendtests');
+require('./tests');
\ No newline at end of file
diff --git a/tests/html/lib/unittests.js b/tests/html/lib/unittests.js
index 9032d49..76506c5 100644
--- a/tests/html/lib/unittests.js
+++ b/tests/html/lib/unittests.js
@@ -26,9 +26,11 @@ test('random_number_string', function() {
 });
 
 test('getOrigin', function() {
-  equal(u.getOrigin('http://a.b/'), 'http://a.b');
-  equal(u.getOrigin('http://a.b/c'), 'http://a.b');
+  equal(u.getOrigin('http://a.b/'), 'http://a.b:80');
+  equal(u.getOrigin('http://a.b/c'), 'http://a.b:80');
   equal(u.getOrigin('http://a.b:123/c'), 'http://a.b:123');
+  equal(u.getOrigin('https://a.b/'), 'https://a.b:443');
+  equal(u.getOrigin('file://a.b/'), null);
 });
 
 test('isSameOriginUrl', function() {
@@ -41,8 +43,8 @@ test('isSameOriginUrl', function() {
   ok(u.isSameOriginUrl('http://localhost:8080', 'http://localhost:8080/'));
   ok(u.isSameOriginUrl('http://127.0.0.1:80/', 'http://127.0.0.1:80/a'));
   ok(u.isSameOriginUrl('http://127.0.0.1:80', 'http://127.0.0.1:80/a'));
-  ok(u.isSameOriginUrl('http://localhost', 'http://localhost:80') === false);
-  ok(u.isSameOriginUrl('http://127.0.0.1/', 'http://127.0.0.1:80/a') === false);
+  ok(u.isSameOriginUrl('http://localhost', 'http://localhost:80'));
+  ok(u.isSameOriginUrl('http://127.0.0.1/', 'http://127.0.0.1:80/a'));
   ok(u.isSameOriginUrl('http://127.0.0.1:9', 'http://127.0.0.1:9999') === false);
   ok(u.isSameOriginUrl('http://127.0.0.1:99', 'http://127.0.0.1:9999') === false);
   ok(u.isSameOriginUrl('http://127.0.0.1:999', 'http://127.0.0.1:9999') === false);
@@ -101,7 +103,7 @@ test('bind', function() {
   fun = function() {
     return this;
   };
-  deepEqual(fun(), window);
+  deepEqual(fun(), undefined);
   bound_fun = u.bind(fun, o);
   deepEqual(bound_fun(), o);
 });
diff --git a/tests/html/tests-qunit.html b/tests/html/tests-qunit.html
index 10c0e2b..870ae13 100644
--- a/tests/html/tests-qunit.html
+++ b/tests/html/tests-qunit.html
@@ -17,10 +17,7 @@
   <script type="text/javascript" src="static/qunit.min.js"></script>
 
   <script type="text/javascript" src="config.js"></script>
-  <script type="text/javascript" src="lib/unittests.js"></script>
-  <script type="text/javascript" src="lib/domtests.js"></script>
-  <script type="text/javascript" src="lib/endtoendtests.js"></script>
-  <script type="text/javascript" src="lib/tests.js"></script>
+  <script type="text/javascript" src="lib/alltestsbundle.js"></script>
 </head>
 <body>
   <p>

-- 
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