Registry / testing / gfm-test-suite

gfm-test-suite

JSON →
library0.0.2jsnpmunverified

The `gfm-test-suite` package, currently at version 0.0.2, provides a JavaScript representation of the GitHub Flavored Markdown (GFM) test suite. It specifically encapsulates the GFM Specification data (version 0.29-gfm, dated 2019-04-06) into a readily consumable JavaScript object. This utility allows developers to programmatically access official GFM test cases, which is invaluable for validating markdown parsers, testing rendering engines, or implementing GFM-compliant features. Its release cadence appears infrequent, with updates primarily addressing compatibility rather than introducing new features, indicating its role as a data-centric library. Its key differentiator is providing direct, structured access to this specific version of the GFM test data without requiring manual parsing of the specification document.

npm install gfm-test-suite
INSTALL
IMPORT
SIG · GFM-TEST-SUITE
G
gfm-test-suite
testingjavascriptv0.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import gfmTestSuite from 'gfm-test-suite'
const gfmTestSuite = require('gfm-test-suite')
The library primarily exports the test suite data as its default export. While CommonJS `require` might work via transpilation, native ESM `import` is the idiomatic approach.
GfmTestSuiteData
import type { GfmTestSuiteData } from 'gfm-test-suite'
Import the TypeScript type definition for the test suite data structure. Essential for type-checking and autocompletion.

Demonstrates how to import the GFM test suite data and access its properties, including the version, date, and individual test cases.

import gfmTestSuite from 'gfm-test-suite'; console.log(`GFM Spec Version: ${gfmTestSuite.version}`); console.log(`GFM Spec Date: ${gfmTestSuite.date}`); console.log(`Total GFM Test Cases: ${gfmTestSuite.testCases.length}`); // Example: Access the first test case const firstCase = gfmTestSuite.testCases[0]; if (firstCase) { console.log('\n--- First Test Case ---'); console.log('Section:', firstCase.section.trim()); console.log('Example:', firstCase.example); console.log('Markdown Input:\n', firstCase.markdown.trim()); console.log('Expected HTML Output:\n', firstCase.html.trim()); }
Debug
Known issues
gotchaThe GFM specification data included in this package is based on version 0.29-gfm, dated 2019-04-06. Newer versions of the GFM specification or GitHub's actual rendering might have evolved since this date, potentially leading to discrepancies if strict up-to-date compliance is required.
fix
Verify if the embedded spec data (via `gfmTestSuite.date` and `gfmTestSuite.version`) is sufficient for your application's needs or if you require a more current source of GFM test data.
affects: >=0.0.1
gotchaThe package is currently at a very early development version (0.0.2). While functional, this might imply a higher risk of unannounced changes in future patch or minor releases, or a lack of long-term maintenance if the author's focus shifts.
fix
Pin to exact versions in production environments (e.g., `"gfm-test-suite": "0.0.2"`) and conduct thorough testing before upgrading.
affects: <1.0.0
gotchaThe quickstart example in the README uses `console.log(latest)` without defining `latest`. The correct usage, implied by the output, is to log the default import `gfmTestSuite` itself or one of its properties.
fix
Always refer to the imported default object (`gfmTestSuite`) for accessing the test suite data, e.g., `console.log(gfmTestSuite)`.
affects: >=0.0.1
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
gfm-test-suite — npm install gfm-test-suite · libregistry