测试:添加测试用的 token 查询接口,不再写死 token

This commit is contained in:
liangtongchuan
2021-02-08 10:54:19 +08:00
parent d889d1b7a4
commit 321e082a2e
5 changed files with 57 additions and 18 deletions
+11 -5
View File
@@ -11,6 +11,7 @@ describe('test zyz login', function() {
// });
// });
var pinusClient;
const loginParms = {serverId: 1};
beforeEach(function(done) {
pinusClient = new PinusWSClient();
@@ -50,11 +51,16 @@ describe('test zyz login', function() {
it('登录测试', function(done) {
expect(1).equal(1);
pinusClient.request('connector.entryHandler.enter', {token:'3dc788mrgqshmu8dawocuiftf4lpkjo8sah6p023rin7396n6o', serverId: 1} , (ret) => {
// 消息回调
expect(ret).to.be.an('object');
expect(ret.code).equal(0);
done();
pinusClient.request('connector.entryHandler.debugQueryToken', {tel: '13911134885', magicWord: 'zyz666server518'}, (res) => {
expect(res).to.be.an('object');
expect(res.data).to.be.an('object');
expect(res.data.token).to.be.an('string');
pinusClient.request('connector.entryHandler.enter', {...loginParms, ...res.data}, (ret) => {
expect(ret).to.be.an('object');
expect(ret.code).equal(0);
// 消息回调
done();
});
});
});
});