mirror of
https://github.com/bitinflow/localtunnel.git
synced 2026-03-15 14:35:54 +00:00
change main export signature to localtunnel(port, opt, fn)
Makes for a simpler hello world app
This commit is contained in:
@@ -21,19 +21,12 @@ test('setup local http server', function(done) {
|
||||
});
|
||||
|
||||
test('setup localtunnel client', function(done) {
|
||||
var client = localtunnel({
|
||||
port: test._fake_port
|
||||
});
|
||||
|
||||
client.on('url', function(url) {
|
||||
assert.ok(new RegExp('^https:\/\/.*localtunnel.me' + '$').test(url));
|
||||
test._fake_url = url;
|
||||
localtunnel(test._fake_port, function(err, tunnel) {
|
||||
assert.ifError(err);
|
||||
assert.ok(new RegExp('^https:\/\/.*localtunnel.me' + '$').test(tunnel.url));
|
||||
test._fake_url = tunnel.url;
|
||||
done();
|
||||
});
|
||||
|
||||
client.on('error', function(err) {
|
||||
done(err);
|
||||
});
|
||||
});
|
||||
|
||||
test('query localtunnel server w/ ident', function(done) {
|
||||
@@ -67,18 +60,10 @@ test('query localtunnel server w/ ident', function(done) {
|
||||
});
|
||||
|
||||
test('request specific domain', function(done) {
|
||||
var client = localtunnel({
|
||||
port: test._fake_port,
|
||||
subdomain: 'abcd'
|
||||
});
|
||||
|
||||
client.on('url', function(url) {
|
||||
assert.ok(new RegExp('^https:\/\/abcd.localtunnel.me' + '$').test(url));
|
||||
client.close();
|
||||
localtunnel(test._fake_port, { subdomain: 'abcd' }, function(err, tunnel) {
|
||||
assert.ifError(err);
|
||||
assert.ok(new RegExp('^https:\/\/abcd.localtunnel.me' + '$').test(tunnel.url));
|
||||
tunnel.close();
|
||||
done();
|
||||
});
|
||||
|
||||
client.on('error', function(err) {
|
||||
console.error(err);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user