Skip to content

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Sep 18, 2015
1 parent 1cd8929 commit d38b3ac
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/oauth.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var expect = require('expect.js');
var urllib = require('urllib');
var muk = require('muk');
Expand Down Expand Up @@ -47,7 +49,7 @@ describe('oauth.js', function () {
api.getAccessToken('code', function (err, data) {
expect(err).to.be.ok();
expect(err.name).to.be.equal('WeChatAPIError');
expect(err.message).to.be.equal('invalid code');
expect(err.message).to.contain('invalid code');
done();
});
});
Expand Down Expand Up @@ -90,7 +92,7 @@ describe('oauth.js', function () {
api.refreshAccessToken('refresh_token', function (err, data) {
expect(err).to.be.ok();
expect(err.name).to.be.equal('WeChatAPIError');
expect(err.message).to.be.equal('invalid appid');
expect(err.message).to.contain('invalid appid');
done();
});
});
Expand Down Expand Up @@ -131,7 +133,7 @@ describe('oauth.js', function () {
api._getUser('openid', 'access_token', function (err, data) {
expect(err).to.be.ok();
expect(err.name).to.be.equal('WeChatAPIError');
expect(err.message).to.be.equal('invalid credential, access_token is invalid or not latest');
expect(err.message).to.contain('invalid credential, access_token is invalid or not latest');
done();
});
});
Expand Down Expand Up @@ -315,7 +317,7 @@ describe('oauth.js', function () {
api.getUser('openid', function (err, data) {
expect(err).to.be.ok();
expect(err).to.have.property('name', 'WeChatAPIError');
expect(err).to.have.property('message', 'refresh_token missing');
expect(err.message).to.contain('refresh_token missing');
done();
});
});
Expand Down

0 comments on commit d38b3ac

Please sign in to comment.