Pārlūkot izejas kodu

Add test to reproduce the bug

Stefano Brilli 10 gadi atpakaļ
vecāks
revīzija
da598d64e4
1 mainītis faili ar 20 papildinājumiem un 0 dzēšanām
  1. 20 0
      test/node/Container/testMakeHtml.js

+ 20 - 0
test/node/Container/testMakeHtml.js

@@ -64,6 +64,26 @@
     });
     });
   });
   });
 
 
+  describe('Converter.options extensions', function () {
+    showdown.extensions.testext = function () {
+      return [{
+        type: 'output',
+        filter: function (text) {
+          runCount = runCount + 1;
+          return text;
+        }
+      }];
+    };
+    var runCount,
+        converter = new showdown.Converter({extensions: ['testext']});
+
+    it('output extensions should run once', function () {
+      runCount = 0;
+      converter.makeHtml('# testext');
+      runCount.should.equal(1);
+    });
+  });
+
   function filter() {
   function filter() {
     return function (file) {
     return function (file) {
       var ext = file.slice(-3);
       var ext = file.slice(-3);