test(shared): add tests for architecture+pattern spectral rules#1835
Merged
rocketstack-matt merged 1 commit intofinos:mainfrom Nov 21, 2025
Merged
test(shared): add tests for architecture+pattern spectral rules#1835rocketstack-matt merged 1 commit intofinos:mainfrom
rocketstack-matt merged 1 commit intofinos:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive test coverage for spectral validation functions in both the architecture and pattern modules, increasing the shared module's test coverage above 90%. The tests validate various ID existence checks and uniqueness constraints used in CALM (Common Architecture Language Model) document validation.
Key Changes
- Added test suites for node and interface ID validation functions in both architecture and pattern contexts
- Added test coverage for ID uniqueness validation across nodes, relationships, and interfaces
- Fixed a syntax issue in
architecture/ids-are-unique.tsby removing an incorrect semicolon after a function declaration
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
shared/src/spectral/functions/pattern/interface-id-exists.spec.ts |
Tests validation that interface IDs exist in pattern schema structures |
shared/src/spectral/functions/pattern/interface-id-exists-on-node.spec.ts |
Tests validation that interface IDs exist on specific nodes in pattern schemas |
shared/src/spectral/functions/pattern/ids-are-unique.spec.ts |
Tests uniqueness validation for IDs across nodes, relationships, and interfaces in pattern schemas |
shared/src/spectral/functions/architecture/node-id-exists.spec.ts |
Tests validation that node IDs exist in architecture documents |
shared/src/spectral/functions/architecture/interface-id-exists.spec.ts |
Tests validation that interface IDs exist in architecture documents |
shared/src/spectral/functions/architecture/interface-id-exists-on-node.spec.ts |
Tests validation that interface IDs exist on specific nodes in architecture documents |
shared/src/spectral/functions/architecture/ids-are-unique.spec.ts |
Tests uniqueness validation for IDs across nodes, relationships, and interfaces in architecture documents |
shared/src/spectral/functions/architecture/ids-are-unique.ts |
Fixed syntax error by removing incorrect semicolon after named function declaration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rocketstack-matt
approved these changes
Nov 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add tests for spectral rules relating to architectures and patterns.
This increases the overall test coverage for the
sharedmodule above 90%.Type of Change
Affected Components
cli/)shared/)calm-widgets/)calm-hub/)calm-hub-ui/)docs/)calm-plugins/vscode/)Commit Message Format ✅
Testing
Checklist