         describe 'node', ->
             it 'starts node server', (done) ->
                 path = createApp (err, _, stderr) ->
-                    child = cp.exec "cd #{path} && #{NEFT_BIN_PATH} run node", (err, _, stderr) ->
+                    child = forkSilent NEFT_BIN_PATH, ['run', 'node'], cwd: path, (err, _, stderr) ->
                         done err or stderr
 
                     child.stdout.on 'data', (msg) ->
-                        if utils.has(msg, 'Start as')
+                        if utils.has(String(msg), 'Start as')
                             child.kill()
                             setTimeout done


NEFT_BIN_PATH = pathUtils.join(fs.realpathSync('./'), 'bin/neft.js')

createApp = (callback) ->
    path = pathUtils.join os.tmpdir(), 'neft-project'
    fs.removeSync path

    cpCmd = "#{NEFT_BIN_PATH} create #{path}"
    cp.exec cpCmd, callback
    path

describe 'CLI', ->

        describe 'node', ->
            it 'creates bundle', (done) ->
                path = createApp (err, _, stderr) ->
                    forkSilent NEFT_BIN_PATH, ['build', 'node'], cwd: path, (err, _, stderr) ->
                        assert.ok fs.existsSync pathUtils.join(path, 'build/app-node-develop.js')
                        done err or stderr

        describe 'browser', ->
            it 'creates bundle', (done) ->
                path = createApp (err, _, stderr) ->
                    forkSilent NEFT_BIN_PATH, ['build', 'browser'], cwd: path, (err, _, stderr) ->
                        assert.ok fs.existsSync pathUtils.join(path, 'build/app-browser-develop.js')
                        done err or stderr

