im.client.management.Test.js 832 B

123456789101112131415161718192021222324252627
  1. /**
  2. * IM客户端单元测试。单元测试编写规则:至少对对每个接口执行正反例测试,若有条件可以增加接口的性能测试。
  3. *
  4. * @author sand
  5. * @since 2016/12/24
  6. */
  7. "use strict";
  8. var $ = require('jquery');
  9. let assert = require('assert');
  10. let imClient = require('../../src/client/im.client');
  11. // 管理API
  12. describe("Management API", function () {
  13. describe("db_status", function () {
  14. it("return success while database is ok", function (done) {
  15. imClient.Management.getDbStatus(function (data) {
  16. assert.strictEqual(Object.keys(data).length > 0, true);
  17. done();
  18. },
  19. function (xhr, status, error) {
  20. assert.ok(false, xhr.responseJSON.message);
  21. done();
  22. });
  23. });
  24. });
  25. });