busterjs / buster

Abandoned - A powerful suite of automated test tools for JavaScript.
http://docs.busterjs.org
Other
448 stars 37 forks source link

buster-ci should pass the server url to buster test cli #448

Closed GCheung55 closed 9 years ago

GCheung55 commented 9 years ago

buster-ci config allows for a server object definition, which contains host and port.

Unfortunately, the port is changed from the default of 1111, it doesn't get passed to buster-test-cli.

The painful way to get around this is to identify the server as an argv AND a config option of buster-ci:

module.exports = {
    server: {
        host: 'localhost',
        port: 1212
    }
}
$ buster-ci --server http://localhost:1212

We'd have to determine which one has higher priority, config file option or argv. I also suggest that we use the url module to parse a string and format an object.

var url = require('url')

var server = {
    hostname: 'localhost',
    port: 1111,
    protocol: 'http'
}

// returns http://localhost:1111
url.format(server)

/* returns
{ protocol: 'http:',
  slashes: true,
  auth: null,
  host: 'localhost:1111',
  port: '1111',
  hostname: 'localhost',
  hash: null,
  search: null,
  query: null,
  pathname: '/',
  path: '/',
  href: 'http://localhost:1111/' }
*/
url.parse('http://localhost:1111')
dwittner commented 9 years ago

Fixed in version 0.2.1 of buster-ci.