Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (22 sloc) 832 Bytes
assert = require 'assert'
path = require 'path'
MainConfig = require '../lib/MainConfig'
describe 'MainConfig', ->
describe 'loadFromFile', ->
it 'returns a sensible error if the config file doesnt exist', ->
MainConfig.loadFromFile 'someBogusFile', (err, config) ->
assert err
assert.equal undefined, config
assert /config file/i.test err.message
describe '.listTargetsAndProcesses', ->
it 'returns a string listing the targets and their accompanying processes', ->
MainConfig.loadFromFile path.join(__dirname, 'fixtures', 'testGgg.js'), (err, config) ->
assert.ifError err
expectedList = """
test:web
test:worker
dev
prod
"""
list = config.listTargetsAndProcesses()
assert.equal list, expectedList
Something went wrong with that request. Please try again.