legacyExtensionSupport.js 659 B

123456789101112131415161718192021222324
  1. /**
  2. * Created by Estevao on 06-06-2015.
  3. */
  4. require('source-map-support').install();
  5. var expect = require('chai').expect,
  6. showdown = require('../bootstrap').showdown;
  7. describe('showdown legacy extension support', function () {
  8. 'use strict';
  9. var extObjMock =
  10. {
  11. type: 'lang',
  12. filter: function () {}
  13. },
  14. extFunc = function () {
  15. return [extObjMock];
  16. };
  17. it('accept extensions loaded by the old mechanism', function () {
  18. showdown.extensions.bazinga = extFunc;
  19. var cnv = new showdown.Converter({extensions: ['bazinga']});
  20. expect(cnv.getAllExtensions().language).to.eql([extObjMock]);
  21. });
  22. });