You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
793 B

4 years ago
  1. "use strict";
  2. describe("loglevel included via node", function () {
  3. it("is included successfully", function () {
  4. expect(require('../lib/loglevel')).not.toBeUndefined();
  5. });
  6. it("allows setting the logging level", function () {
  7. var log = require('../lib/loglevel');
  8. log.setLevel(log.levels.TRACE);
  9. log.setLevel(log.levels.DEBUG);
  10. log.setLevel(log.levels.INFO);
  11. log.setLevel(log.levels.WARN);
  12. log.setLevel(log.levels.ERROR);
  13. });
  14. it("successfully logs", function () {
  15. var log = require('../lib/loglevel');
  16. console.info = jasmine.createSpy("info");
  17. log.setLevel(log.levels.INFO);
  18. log.info("test message");
  19. expect(console.info).toHaveBeenCalledWith("test message");
  20. });
  21. });