mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-03-26 07:44:10 +08:00
fix unit test
This commit is contained in:
@@ -132,7 +132,7 @@ app.express.get '/', (req, res) ->
|
||||
|
||||
app.express.use harp.mount './core/static'
|
||||
|
||||
unless module.parent
|
||||
exports.start = _.once ->
|
||||
app.express.listen config.web.listen, ->
|
||||
app.started = true
|
||||
|
||||
@@ -143,3 +143,6 @@ unless module.parent
|
||||
hook.action()
|
||||
|
||||
app.logger.log "RootPanel start at #{config.web.listen}"
|
||||
|
||||
unless module.parent
|
||||
exports.start()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
describe 'app', ->
|
||||
it 'should can startup', ->
|
||||
@timeout 20000
|
||||
require '../../app'
|
||||
require('../../app').start()
|
||||
|
||||
it 'should connected to mongodb', (done) ->
|
||||
async.forever (callback) ->
|
||||
@@ -12,15 +12,6 @@ describe 'app', ->
|
||||
, ->
|
||||
done()
|
||||
|
||||
it 'express should be started', (done) ->
|
||||
async.forever (callback) ->
|
||||
if app.started
|
||||
callback true
|
||||
else
|
||||
setImmediate callback
|
||||
, ->
|
||||
done()
|
||||
|
||||
it 'app.libs should be loaded', ->
|
||||
{_, express, fs, mongoose} = app.libs
|
||||
_.should.be.ok
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
it 'GET /:category/:title', (done) ->
|
||||
agent.get '/wiki/FAQ/Billing.md'
|
||||
.expect if config.plugins.wiki.disable_default_wiki then 404 else 200
|
||||
.expect if config.plugins.wiki?.disable_default_wiki then 404 else 200
|
||||
.end done
|
||||
|
||||
it 'GET /:category/:title when not exist', (done) ->
|
||||
|
||||
Reference in New Issue
Block a user