add test for invalid subdomain requests

This commit is contained in:
Roman Shtylman committed 2014-04-20 11:05:57 -04:00
1 parent dd6d04c2cf
commit 8abb4f395f
3 files changed
+17 -5

No files matched your search

+13
View File
@@ -91,6 +91,19 @@ test('request specific domain', function(done) {
});
});
test('request domain that is too long', function(done) {
var opt = {
host: 'http://localhost:' + lt_server_port,
subdomain: 'thisdomainisoutsidethesizeofwhatweallow'
};
localtunnel(test._fake_port, opt, function(err, tunnel) {
assert(err);
assert.equal(err.message, 'Invalid subdomain. Subdomains must be between 4 and 20 alphanumeric characters.');
done();
});
});
test('shutdown', function() {
localtunnel_server.close();
});