UNPKG

@informalsystems/quint

Version:

Core tool for the Quint specification language

39 lines 1.35 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const chai_1 = require("chai"); const mocha_1 = require("mocha"); const docs_1 = require("../src/docs"); const ir_1 = require("./builders/ir"); const textUtils_1 = require("./textUtils"); (0, mocha_1.describe)('produceDocs', () => { const module = (0, ir_1.buildModuleWithDecls)([ (0, textUtils_1.dedent)(`/// This is a docstring for foo |val foo = 1`), ]); (0, mocha_1.it)('produces documentation for all definitions', () => { const docs = (0, docs_1.produceDocs)(module); chai_1.assert.sameDeepMembers([...docs.values()], [ { name: 'foo', signature: 'val foo', documentation: 'This is a docstring for foo', }, ]); }); }); (0, mocha_1.describe)('toMarkdown', () => { const doc = { name: 'foo', signature: 'val foo', documentation: 'This is a docstring for foo', }; (0, mocha_1.it)('produces markdown out of a documentation entry', () => { const expectedMarkdown = (0, textUtils_1.dedent)(`## foo | |Signature: \`val foo\` | |This is a docstring for foo`); chai_1.assert.deepEqual((0, docs_1.toMarkdown)(doc), expectedMarkdown); }); }); //# sourceMappingURL=docs.test.js.map