[Pkg-javascript-commits] [sockjs-client] 253/350: Move some tests to node-only because url-parse handles relative urls in a browser
tonnerre at ancient-solutions.com
tonnerre at ancient-solutions.com
Fri Aug 5 01:04:27 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 bc2283cfa317ba9b49304a986d969fb60ffb8f19
Author: Bryce Kahle <bkahle at gmail.com>
Date: Wed Oct 29 15:04:21 2014 -0400
Move some tests to node-only because url-parse handles relative urls in a browser
---
tests/lib/main-node.js | 25 +++++++++++++++++++++----
tests/lib/main.js | 14 --------------
2 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/tests/lib/main-node.js b/tests/lib/main-node.js
index bd08272..f269530 100644
--- a/tests/lib/main-node.js
+++ b/tests/lib/main-node.js
@@ -8,11 +8,12 @@ describe('SockJS', function() {
describe('Constructor', function () {
describe('WebSocket specification step #2', function () {
+ var main = proxyquire('../../lib/main', { './location': {
+ protocol: 'https'
+ }});
+ var sjs = proxyquire('../../lib/entry', { './main': main });
+
it('should throw SecurityError for an insecure url from a secure page', function () {
- var main = proxyquire('../../lib/main', { './location': {
- protocol: 'https'
- }});
- var sjs = proxyquire('../../lib/entry', { './main': main });
expect(function () {
sjs('http://localhost');
}).to.throwException(function (e) {
@@ -20,6 +21,22 @@ describe('SockJS', function() {
expect(e.message).to.contain('SecurityError');
});
});
+
+ it('should throw SyntaxError for an invalid url', function () {
+ expect(function () {
+ sjs('//localhost');
+ }).to.throwException(function (e) {
+ expect(e).to.be.a(SyntaxError);
+ });
+ });
+
+ it('should throw SyntaxError for an empty url - #8', function () {
+ expect(function () {
+ sjs('');
+ }).to.throwException(function (e) {
+ expect(e).to.be.a(SyntaxError);
+ });
+ });
});
});
diff --git a/tests/lib/main.js b/tests/lib/main.js
index 5afcadb..d507568 100644
--- a/tests/lib/main.js
+++ b/tests/lib/main.js
@@ -26,26 +26,12 @@ describe('SockJS', function() {
describe('WebSocket specification step #1', function () {
it('should throw SyntaxError for an invalid url', function () {
expect(function () {
- new SockJS('//localhost');
- }).to.throwException(function (e) {
- expect(e).to.be.a(SyntaxError);
- });
-
- expect(function () {
new SockJS('http://');
}).to.throwException(function (e) {
expect(e).to.be.a(SyntaxError);
});
});
- it('should throw SyntaxError for an empty url - #8', function () {
- expect(function () {
- new SockJS('');
- }).to.throwException(function (e) {
- expect(e).to.be.a(SyntaxError);
- });
- });
-
it('should throw TypeError for an null url', function () {
expect(function () {
new SockJS();
--
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