暫無描述

index.js 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. var console = require("../index")
  2. var test = require("tape")
  3. if (typeof window !== "undefined" && !window.JSON) {
  4. window.JSON = require("jsonify")
  5. }
  6. test("console has expected methods", function (assert) {
  7. assert.ok(console.log)
  8. assert.ok(console.info)
  9. assert.ok(console.warn)
  10. assert.ok(console.dir)
  11. assert.ok(console.time, "time")
  12. assert.ok(console.timeEnd, "timeEnd")
  13. assert.ok(console.trace, "trace")
  14. assert.ok(console.assert)
  15. assert.end()
  16. })
  17. test("invoke console.log", function (assert) {
  18. console.log("test-log")
  19. assert.end()
  20. })
  21. test("invoke console.info", function (assert) {
  22. console.info("test-info")
  23. assert.end()
  24. })
  25. test("invoke console.warn", function (assert) {
  26. console.warn("test-warn")
  27. assert.end()
  28. })
  29. test("invoke console.time", function (assert) {
  30. console.time("label")
  31. assert.end()
  32. })
  33. test("invoke console.trace", function (assert) {
  34. console.trace("test-trace")
  35. assert.end()
  36. })
  37. test("invoke console.assert", function (assert) {
  38. console.assert(true)
  39. assert.end()
  40. })
  41. test("invoke console.dir", function (assert) {
  42. console.dir("test-dir")
  43. assert.end()
  44. })
  45. test("invoke console.timeEnd", function (assert) {
  46. console.timeEnd("label")
  47. assert.end()
  48. })