-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Open
Labels
type: featurePull requests that introduces new featurePull requests that introduces new feature
Description
Description:
In timestamp.test.ts, common helper functions plain, paragraph, bold, and strike are defined inline instead of being imported from the shared helpers.ts file used by all other test files in the same directory.
Expected Behavior
timestamp.test.ts should import plain, paragraph, bold, and strike from helpers.ts, consistent with every other test file in the package.
Current Behavior
// these are defined inline in timestamp.test.ts
const plain = (value: string) => ({ type: 'PLAIN_TEXT' as const, value });
const paragraph = (value: Array<Record<string, unknown>>) => ({ type: 'PARAGRAPH' as const, value });
const bold = (value: Array<Record<string, unknown>>) => ({ type: 'BOLD' as const, value });
const strike = (value: Array<Record<string, unknown>>) => ({ type: 'STRIKE' as const, value });Steps to Reproduce
See packages/message-parser/tests/timestamp.test.ts
Additional Context
- Every other test file in the package imports these helpers from helpers.ts
- If the shape of a node changes in
helpers.ts, the inline definitions intimestamp.test.tscould silently drift out of sync - The fix is purely a code cleanup with no behavior change
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type: featurePull requests that introduces new featurePull requests that introduces new feature