Skip to content

Conversation

@davidjgoss
Copy link
Collaborator

@davidjgoss davidjgoss commented Nov 28, 2025

🤔 What's changed?

Add support for code snippets (suggestions) for undefined steps.

This manifests in two ways:

  • In the suggestion messages - CCK samples that include these are now passing
  • In the node test output, via what we pass to the UndefinedError - these get syntax highlighted too, so they stand out and are more readable in the terminal

The code will either be plain JavaScript or, if we detect at least some user-authored code came from ts files, TypeScript.

image

⚡️ What's your motivation?

Fixes #36.

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

import { styleText } from 'node:util'

import { AssembledTestStep, DataTable } from '@cucumber/core'
// @ts-expect-error incomplete types
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidjgoss davidjgoss changed the title Add snippets Surface code snippets for undefined steps Nov 28, 2025
@davidjgoss davidjgoss marked this pull request as ready for review November 28, 2025 15:48
@davidjgoss davidjgoss merged commit 3823ed3 into main Nov 28, 2025
11 checks passed
@davidjgoss davidjgoss deleted the snippets branch November 28, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Snippets

1 participant