Skip to content

feat: Add advice override for 'MISSING_TRIGGER_FUNCTION' - #1352

Merged
TimothyJones merged 2 commits into
case-contract-testing:mainfrom
JamesBurnsCanva:20260716-missing-trigger-advice-override
Jul 18, 2026
Merged

feat: Add advice override for 'MISSING_TRIGGER_FUNCTION'#1352
TimothyJones merged 2 commits into
case-contract-testing:mainfrom
JamesBurnsCanva:20260716-missing-trigger-advice-override

Conversation

@JamesBurnsCanva

Copy link
Copy Markdown
Contributor

Context

I support an internal wrapper library around Contract Case.
I want to provide custom error messages on particular failures so that I can give internal users guidance on how to fix their problem in the context of our wrapper library.
Advice overrides are already supported for MISSING_REGISTERED_FUNCTION (source), but not for MISSING_TRIGGER_FUNCTION.

Done in this PR

Added support for custom advice overrides for the error code MISSING_TRIGGER_FUNCTION.

Behaviour of the change was manually verified by testing it in my project that uses Contract Case.

@TimothyJones TimothyJones left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good! One minor change request and I'll get this released

import { Assertable } from '../../entities/types';
import { CaseFailedAssertionError } from '../../entities';

const advice = (context: MatchContext) =>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's call this missingTriggerAdvice, as it's defined quite a long way from where it's used.

@TimothyJones TimothyJones changed the title Add advice override for 'MISSING_TRIGGER_FUNCTION' feat: Add advice override for 'MISSING_TRIGGER_FUNCTION' Jul 17, 2026
@TimothyJones
TimothyJones merged commit f10c45d into case-contract-testing:main Jul 18, 2026
14 checks passed
@TimothyJones

Copy link
Copy Markdown
Member

Update: I merged and did the rename. I'll get this out shortly.

@TimothyJones

Copy link
Copy Markdown
Member

Released in 0.30.1 in both Maven and npm.

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.

2 participants