mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Compile coffee files and remove them
With, ./node_modules/.bin/coffee -b -c Cakefile `find . -path ./node_modules -prune -o -name '*.coffee'`
This commit is contained in:
parent
82562fb21d
commit
31ad9566e6
38 changed files with 2277 additions and 1725 deletions
32
proxy/spec/websocket.spec.js
Normal file
32
proxy/spec/websocket.spec.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
// Generated by CoffeeScript 2.4.1
|
||||
/*
|
||||
jasmine tests for Snowflake websocket
|
||||
*/
|
||||
describe('BuildUrl', function() {
|
||||
it('should parse just protocol and host', function() {
|
||||
return expect(WS.buildUrl('http', 'example.com')).toBe('http://example.com');
|
||||
});
|
||||
it('should handle different ports', function() {
|
||||
expect(WS.buildUrl('http', 'example.com', 80)).toBe('http://example.com');
|
||||
expect(WS.buildUrl('http', 'example.com', 81)).toBe('http://example.com:81');
|
||||
expect(WS.buildUrl('http', 'example.com', 443)).toBe('http://example.com:443');
|
||||
return expect(WS.buildUrl('http', 'example.com', 444)).toBe('http://example.com:444');
|
||||
});
|
||||
it('should handle paths', function() {
|
||||
expect(WS.buildUrl('http', 'example.com', 80, '/')).toBe('http://example.com/');
|
||||
expect(WS.buildUrl('http', 'example.com', 80, '/test?k=%#v')).toBe('http://example.com/test%3Fk%3D%25%23v');
|
||||
return expect(WS.buildUrl('http', 'example.com', 80, '/test')).toBe('http://example.com/test');
|
||||
});
|
||||
it('should handle params', function() {
|
||||
expect(WS.buildUrl('http', 'example.com', 80, '/test', [['k', '%#v']])).toBe('http://example.com/test?k=%25%23v');
|
||||
return expect(WS.buildUrl('http', 'example.com', 80, '/test', [['a', 'b'], ['c', 'd']])).toBe('http://example.com/test?a=b&c=d');
|
||||
});
|
||||
it('should handle ips', function() {
|
||||
expect(WS.buildUrl('http', '1.2.3.4')).toBe('http://1.2.3.4');
|
||||
return expect(WS.buildUrl('http', '1:2::3:4')).toBe('http://[1:2::3:4]');
|
||||
});
|
||||
return it('should handle bogus', function() {
|
||||
expect(WS.buildUrl('http', 'bog][us')).toBe('http://bog%5D%5Bus');
|
||||
return expect(WS.buildUrl('http', 'bog:u]s')).toBe('http://bog%3Au%5Ds');
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue