Permalink
Browse files

split --local into --local and --port (closes #198)

  • Loading branch information...
vweevers committed Jul 6, 2018
1 parent 98db015 commit 80a5870f3f0e2153b32516f2e10fbb2fa44dee84
Showing with 8 additions and 8 deletions.
  1. +1 −1 README.md
  2. +3 −1 bin/airtap.js
  3. +1 −1 doc/debugging.md
  4. +1 −4 lib/setup.js
  5. +2 −1 test/unit/airtap.js
@@ -40,7 +40,7 @@ All you need is an entry point for your tests like `test.js`. When iterating on
See the included [example](./example) for a simple test. Run it by issuing the following command in the example directory:

```
airtap --local 8080 test.js
airtap --local test.js
```

It will print a URL that you can open in any local browser to run the tests. Make changes to the code as needed. No need to restart airtap, just refresh your browser.
@@ -25,7 +25,8 @@ var aggregate = require('../lib/aggregate-browsers')
program
.version(require('../package.json').version)
.usage('[options] <files | dir>')
.option('--local [port]', 'port for manual testing in a local browser')
.option('--local', 'run tests in a local browser of choice')
.option('--port <port>', 'port for bouncer server, defaults to a free port')
.option('--electron', 'run tests in electron. electron must be installed separately.')
.option('--tunnel-id <id>', 'Tunnel identifier for Sauce Connect, default TRAVIS_JOB_NUMBER or none')
.option('--loopback <host name>', 'hostname to use instead of localhost, to accomodate Safari and Edge with Sauce Connect. Must resolve to 127.0.0.1')
@@ -44,6 +45,7 @@ program
var config = {
files: program.args,
local: program.local,
port: program.port,
electron: program.electron,
prj_dir: process.cwd(),
tunnel_id: program.tunnelId,
@@ -1,3 +1,3 @@
# Debugging Airtap

Run `airtap --local 9000 test/mytest.js` and open up [http://localhost:9000/airtap](http://localhost:9000/airtap) in your browser of choice.
Run `airtap --local --port 9000 test/mytest.js` and open up [http://localhost:9000/airtap](http://localhost:9000/airtap) in your browser of choice.
@@ -33,10 +33,7 @@ function setupTestServer (opts, cb) {
// TODO start support server
// currently happens within userServer

var bouncerPort = 0
if (opts.local && parseInt(opts.local)) {
bouncerPort = opts.local
}
var bouncerPort = opts.port || 0

var proxy = httpProxy.createProxy()
proxy.on('proxyReq', onProxyRequest)
@@ -50,7 +50,8 @@ test('browsers are deduped', function (t) {

test('loopback is ignored in local mode', function (t) {
var airtap = Airtap({
local: 3000,
local: true,
port: 3000,
loopback: 'airtap.local',
prj_dir: path.resolve(__dirname, '../fixtures/tape'),
files: [ path.resolve(__dirname, '../fixtures/tape/test.js') ]

0 comments on commit 80a5870

Please sign in to comment.