diff --git a/config.json b/config.json index d8304ad..c346103 100644 --- a/config.json +++ b/config.json @@ -12,7 +12,7 @@ "/prize/ajax/prizeDraw?groupId=198": { "code": 200, "msg": {} - }, + }, "/test": { "code": 200, "msg": "hello world!" diff --git a/test/test.js b/test/test.js index dedfb0d..db454b0 100644 --- a/test/test.js +++ b/test/test.js @@ -48,7 +48,10 @@ describe('Routes', function() { }) it('should get the request in config.json ', function(done) { request.get('http://localhost:3000/prize/ajax/prizeDraw?groupId=198', function(err,res, body) { - assert(config.ajaxList[res.req.path]) + var path = res.req.path; + var result = config.ajaxList[path]; + var res_body = JSON.parse(body); + assert.deepEqual(result,res_body) done(); }); })