memory-test.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. var path = require('path'),
  2. vows = require('vows'),
  3. assert = require('assert'),
  4. winston = require('../../lib/winston'),
  5. helpers = require('../helpers');
  6. var npmTransport = new (winston.transports.Memory)(),
  7. syslogTransport = new (winston.transports.Memory)({ levels: winston.config.syslog.levels });
  8. vows.describe('winston/transports/memory').addBatch({
  9. "An instance of the Memory Transport": {
  10. "with npm levels": {
  11. "should have the proper methods defined": function () {
  12. helpers.assertMemory(npmTransport);
  13. },
  14. "the log() method": helpers.testNpmLevels(npmTransport, "should respond with true", function (ign, err, logged) {
  15. assert.isNull(err);
  16. assert.isTrue(logged);
  17. })
  18. },
  19. "with syslog levels": {
  20. "should have the proper methods defined": function () {
  21. helpers.assertMemory(syslogTransport);
  22. },
  23. "the log() method": helpers.testSyslogLevels(syslogTransport, "should respond with true", function (ign, err, logged) {
  24. assert.isNull(err);
  25. assert.isTrue(logged);
  26. })
  27. }
  28. }
  29. }).export(module);