Skip to content

Commit

Permalink
fix tests; upgrade should and connect
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Yang committed Apr 15, 2015
1 parent d8840e0 commit a7436ac
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
},
"devDependencies": {
"mocha": "*",
"should": "*",
"should": "^6.0.0",
"ejs": "*",
"jscover": "*",
"supertest": "*",
"connect": "*"
"connect": "^3.3.3",
"connect-query": "^0.2.0"
},
"engines": {
"node" : ">=0.6.0",
Expand Down
28 changes: 15 additions & 13 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ var tail = require('./support').tail;
var connect = require('connect');
var webot = require('../');

connect.query = require('connect-query');

describe('weixin.js', function () {
describe('watch option', function () {
var app;
Expand Down Expand Up @@ -78,11 +80,11 @@ describe('weixin.js', function () {
return done(err);
}
var body = res.text.toString();
body.should.include('<ToUserName><![CDATA[diaosi]]></ToUserName>');
body.should.include('<FromUserName><![CDATA[nvshen]]></FromUserName>');
body.should.containEql('<ToUserName><![CDATA[diaosi]]></ToUserName>');
body.should.containEql('<FromUserName><![CDATA[nvshen]]></FromUserName>');
body.should.match(/<CreateTime>\d{10}<\/CreateTime>/);
body.should.include('<MsgType><![CDATA[text]]></MsgType>');
body.should.include('<Content><![CDATA[你好]]></Content>');
body.should.containEql('<MsgType><![CDATA[text]]></MsgType>');
body.should.containEql('<Content><![CDATA[你好]]></Content>');
done();
});
});
Expand All @@ -104,7 +106,7 @@ describe('weixin.js', function () {
.end(function(err, res){
if (err) return done(err);
var body = res.text.toString();
body.should.include('<MsgType><![CDATA[news]]></MsgType>');
body.should.containEql('<MsgType><![CDATA[news]]></MsgType>');
done();
});
});
Expand All @@ -123,7 +125,7 @@ describe('weixin.js', function () {
.end(function(err, res){
if (err) return done(err);
var body = res.text.toString();
body.should.include('<MsgType><![CDATA[music]]></MsgType>');
body.should.containEql('<MsgType><![CDATA[music]]></MsgType>');
done();
});
});
Expand Down Expand Up @@ -155,7 +157,7 @@ describe('weixin.js', function () {
.end(function(err, res){
if (err) return done(err);
var body = res.text.toString();
body.should.include('<Content><![CDATA[' + JSON.stringify(param) + ']]></Content>');
body.should.containEql('<Content><![CDATA[' + JSON.stringify(param) + ']]></Content>');
done();
});
});
Expand All @@ -176,7 +178,7 @@ describe('weixin.js', function () {
.end(function(err, res){
if (err) return done(err);
var body = res.text.toString();
body.should.include('<Content><![CDATA[' + (info.recognition + info.recognition) + ']]></Content>');
body.should.containEql('<Content><![CDATA[' + (info.recognition + info.recognition) + ']]></Content>');
done();
});
});
Expand Down Expand Up @@ -273,11 +275,11 @@ describe('weixin.js', function () {
.end(function(err, res){
if (err) return done(err);
var body = res.text.toString();
body.should.include('<ToUserName><![CDATA[diaosi]]></ToUserName>');
body.should.include('<FromUserName><![CDATA[nvshen]]></FromUserName>');
body.should.containEql('<ToUserName><![CDATA[diaosi]]></ToUserName>');
body.should.containEql('<FromUserName><![CDATA[nvshen]]></FromUserName>');
body.should.match(/<CreateTime>\d{10}<\/CreateTime>/);
body.should.include('<MsgType><![CDATA[text]]></MsgType>');
body.should.include('<Content><![CDATA[你好]]></Content>');
body.should.containEql('<MsgType><![CDATA[text]]></MsgType>');
body.should.containEql('<Content><![CDATA[你好]]></Content>');
done();
});
});
Expand Down Expand Up @@ -322,7 +324,7 @@ describe('weixin.js', function () {
return done(err);
}
var body = res.text.toString();
body.should.include('<Content><![CDATA[]]></Content>');
body.should.equal('');
done();
});
});
Expand Down

0 comments on commit a7436ac

Please sign in to comment.