stats.Test.js 863 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Created by Sand Wen on 2016.11.18.
  3. */
  4. var assert = require('assert');
  5. var StatsMessage = require('../../../src/doctor/models/stats.js');
  6. describe('StatsMessage class', function () {
  7. describe('When test constructor', function () {
  8. it('should return the object', function () {
  9. var sm = new StatsMessage();
  10. assert.strictEqual(sm !== null, true);
  11. });
  12. });
  13. describe('getBadgeNumber', function () {
  14. describe('When the data is ready', function () {
  15. it('should get "ok" event', function () {
  16. var sm = new StatsMessage();
  17. sm.on('ok', function (data) {
  18. console.log(data);
  19. assert.strictEqual(data.length > 0, true);
  20. });
  21. sm.getBadgeNumber("sand");
  22. });
  23. });
  24. });
  25. });