add first modul testing
This commit is contained in:
parent
10b6a7d47b
commit
908f09a014
|
@ -4,6 +4,7 @@ request = require('request')
|
|||
lib = require('./lib')
|
||||
|
||||
config = require('./config')
|
||||
modules = require('./modul')
|
||||
|
||||
describe('API',->
|
||||
it('status',(done)->
|
||||
|
@ -625,6 +626,7 @@ describe('API',->
|
|||
)
|
||||
)
|
||||
)
|
||||
modules()
|
||||
describe('delete',->
|
||||
it('-> without login',(done)->
|
||||
request({method: 'GET',uri:config.ADDRESS+"/delete"},(err,res,body)->
|
||||
|
|
|
@ -17,5 +17,5 @@ module.exports.login = (args,args2)->
|
|||
expect(err).to.be.null
|
||||
expect(res.statusCode).to.be.equal(200)
|
||||
expect(body.data).to.be.true
|
||||
call(j)
|
||||
call(j,body.session)
|
||||
)
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
web = require('./web')
|
||||
|
||||
module.exports = ()->
|
||||
describe('MODULES',->
|
||||
web()
|
||||
)
|
|
@ -0,0 +1,24 @@
|
|||
expect = require("chai").expect
|
||||
request = require('request')
|
||||
|
||||
lib = require('../lib')
|
||||
|
||||
config = require('../config')
|
||||
|
||||
module.exports = ()->
|
||||
describe('web',->
|
||||
it('test of test',(done)->
|
||||
lib.login((j,login)->
|
||||
request({method: 'GET',uri:config.ADDRESS+"/web/involve",jar:j},(err,res,body)->
|
||||
expect(err).to.be.null
|
||||
expect(res.statusCode).to.be.equal(200)
|
||||
if(typeof body == "string")
|
||||
body = JSON.parse(body)
|
||||
expect(body.error).to.be.undefined
|
||||
expect(body.data).to.be.a("array")
|
||||
console.log(login,body.data)
|
||||
done()
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
Reference in New Issue