add test for invalid subdomain requests

This commit is contained in:
Roman Shtylman
2014-04-20 11:05:57 -04:00
parent dd6d04c2cf
commit 8abb4f395f
3 changed files with 17 additions and 5 deletions

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();
});