forked from thoov/mock-socket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
url-transform-test.js
15 lines (14 loc) · 1005 Bytes
/
url-transform-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module('Url Transform Tests');
test('Url transform is done correctly', function(){
equal(urlTransform('ws://localhost:8080'), 'ws://localhost:8080/');
equal(urlTransform('ws://localhost:8080/'), 'ws://localhost:8080/');
equal(urlTransform('ws://localhost:8080/foo'), 'ws://localhost:8080/foo');
equal(urlTransform('ws://localhost.com'), 'ws://localhost.com/');
equal(urlTransform('ws://localhost.com:8080/'), 'ws://localhost.com:8080/');
equal(urlTransform('ws://localhost.com/foo'), 'ws://localhost.com/foo');
equal(urlTransform('ws://localhost.com/foo/'), 'ws://localhost.com/foo/');
equal(urlTransform('ws://localhost.com?foo=bar'), 'ws://localhost.com/?foo=bar');
equal(urlTransform('ws://localhost.com/foo?foo=bar'), 'ws://localhost.com/foo?foo=bar');
equal(urlTransform('ws://localhost:8080?foo=bar&testing=true'), 'ws://localhost:8080/?foo=bar&testing=true');
equal(urlTransform('ws://localhost:8080/?foo=bar&testing=true'), 'ws://localhost:8080/?foo=bar&testing=true');
});