1. markdown-it-testgen
Tests generator for markdown-it markdown parser
markdown-it-testgen
Package: markdown-it-testgen
Created by: markdown-it
Last modified: Sun, 19 Jun 2022 16:09:46 GMT
Version: 0.1.6
License: MIT
Downloads: 1,377
Repository: https://github.com/markdown-it/markdown-it-testgen

Install

npm install markdown-it-testgen
yarn add markdown-it-testgen

markdown-it-testgen

Build Status
NPM version

This package parses fixtures in commonmark spec format and generates tests for
markdown-it parser and
plugins.

 npm install markdown-it-testgen

Fixture format

Each fixture can have optional metadata in yaml format:

 ---
desc: Batch description # file name used if not exists.
skip: true              # mark batch as pending
---

Then tests should follow in this format:

optional header
.
source
data
.
parsed
data
.


header2
.
src
.
result
.

If header missed - line number will be used instead.

API

module.exports(path, options, md)

  • path - file or directory name
  • options (not mandatory)
    • header - Default false. Set true to use heaters for test names
    • sep - array of allowed separators for samples, [ '.' ] by default
    • assert - custom assertion package, require('chai').assert by default.
  • md - markdown-it instance to parse and compare samples

module.exports.load(path, options, iterator)

For each loaded file - parse and pass data to iterator functions. Currently used for tests only.

License

MIT

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin