Registry / testing / handlebars-helpers-ctrf

handlebars-helpers-ctrf

JSON →
library0.0.8jsnpmunverified

A collection of Handlebars helpers for Common Test Report Format (CTRF). Current stable version: 0.0.8. Provides utility functions for sorting, filtering, and analyzing CTRF test results, including helpers for fail rate, flaky rate, test status filters, and many generic helpers (array, string, math, etc.). Active development, no release cadence established. Differentiators: purpose-built for CTRF reports, TypeScript-first, ESM-only.

npm install handlebars-helpers-ctrf
INSTALL
IMPORT
SIG · HANDLEBARS-HELPERS
H
handlebars-helpers-ctrf
testingjavascriptv0.0.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

loadHelpers
import { loadHelpers } from 'handlebars-helpers-ctrf'
const { loadHelpers } = require('handlebars-helpers-ctrf')
ESM-only package (node>=20.19.0). CommonJS require will fail.
sortTestsByFailRate
import { sortTestsByFailRate } from 'handlebars-helpers-ctrf'
Named export for individual helper. Available as a regular function for programmatic use.
filterPassedTests
import { filterPassedTests } from 'handlebars-helpers-ctrf'
import { FilterPassedTests } from 'handlebars-helpers-ctrf'
Case-sensitive; must match export name exactly.

Installs and registers all helpers with Handlebars, then uses the append helper.

import Handlebars from 'handlebars'; import { loadHelpers } from 'handlebars-helpers-ctrf'; loadHelpers(Handlebars); const template = Handlebars.compile('{{append "test" ".html"}}'); const result = template({}); console.log(result); // "test.html"
Debug
Known issues
breakingPackage is ESM-only and requires Node.js >=20.19.0; CommonJS require() will throw.
fix
Use import syntax and ensure Node.js >=20.19.0.
affects: >=0.0.8
gotchaHelper names are case-sensitive and must match exact export names (e.g., 'sortTestsByFailRate' not 'sorttestsbyfailrate').
fix
Refer to documentation for correct casing.
affects: >=0.0.1
deprecatedNo breaking changes reported yet; watch for future deprecations.
fix
Stay updated with changelog.
affects: 0.0.x
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module not supported
Using CommonJS require() on an ESM-only package.
fix
Switch to import syntax or use dynamic import with --experimental-require-module in Node 20+.
TypeError: Handlebars.registerHelper is not a function
loadHelpers expects a valid Handlebars instance; passing a wrong object or uninitialized instance.
fix
Ensure you import Handlebars correctly: import Handlebars from 'handlebars'.
Upgrade
Version history
0.0.8latest on npm
Audit
Dependencies
handlebarsrequiredPeer dependency; the library registers helpers with Handlebars instance.
Agent activity
8 hits · last 30 days
node
8
Resources
handlebars-helpers-ctrf — npm install handlebars-helpers-ctrf · libregistry