import {expect} from "chai"; import {describe, it} from "mocha"; import EchartsPlugin, {Defaults} from "../src/markdown-it-plugin-echarts"; const MarkdownIt = require("markdown-it"); const MarkdownTemplate = (source: string, tag='echarts') => `# Markdown header Some *Markdown* text before the code fences. \`\`\`${tag} ${source} \`\`\`` const basicYaml = `xAxis: type: category data: - Mon - Tue - Wed - Thu - Fri - Sat - Sun yAxis: type: value series: - data: - 120 - 200 - 150 - 80 - 70 - 110 - 130 type: bar showBackground: true backgroundStyle: color: 'rgba(180, 180, 180, 0.2)' ` const basicExpected = (w: number, h: number) => `050100150200MonTueWedThuFriSatSun\n`; describe("Basic testing", function () { const mdi = new MarkdownIt(); mdi.use(EchartsPlugin); it("regular mode", function (done) { const result = mdi.render(MarkdownTemplate(basicYaml)); expect(result.slice(result.indexOf("