Skip to content

cucumber/cucumber-json-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

13e5b15 · Apr 23, 2025
Feb 23, 2025
Apr 18, 2024
Apr 9, 2024
Apr 5, 2025
Aug 13, 2023
Apr 9, 2024
Mar 9, 2022
Apr 9, 2024
Apr 18, 2024
Mar 9, 2022
Mar 22, 2022
Mar 23, 2022
Mar 23, 2022
Feb 23, 2025
Apr 23, 2025
Apr 23, 2025
Dec 22, 2022
Apr 9, 2024
Apr 9, 2024

Repository files navigation

Cucumber JSON Converter

This library converts Cucumber JSON from multiple implementations and versions into a JavaScript object with a strict schema.

Usage

import { convert } from '@cucumber/cucumber-json-converter'

const ob = JSON.parse(jsonFromAnyCucumberImplementation)
const cucumberJsonObject = convert(ob)

The convert function will throw an error if it fails to recognize the object as a valid Cucumber JSON object.

Motivation

The "Cucumber JSON" format was created several years before the JSON Schema standard started gaining traction. The lack of a formal schema led to inconsistencies between different Cucumber implementations and releases.

This library contains JSON Schemas for multiple implementations and versions of Cucumber. These schemas have been retrofitted to match the actual output of these implementations.