Skip to content

test: Add unit test for unrecognized model element in ModelFile - #1132

Merged
mttrbrts merged 1 commit into
accordproject:mainfrom
23harshitkumar:fix/test-coverage-modelfile
Feb 14, 2026
Merged

mttrbrts merged 1 commit into
accordproject:mainfrom
23harshitkumar:fix/test-coverage-modelfile

Conversation

@23harshitkumar

@23harshitkumar 23harshitkumar commented Feb 14, 2026 •

Copy link
Copy Markdown
Contributor

Fixes: N/A

Problem:

The ModelFile constructor logic for handling unrecognized model elements was not covered by unit tests, leaving a potential gap in error handling verification. A TODO comment in test/composer/i18n.js requested functional testing for this case, but it remained unimplemented.

Summary

This PR adds a unit test to concerto-core/test/composer/i18n.js to verify that the ModelFile.js constructor correctly throws an IllegalModelException when encountering an unrecognized model element.

This change fulfills a longstanding TODO in the test file and improves functional coverage for error handling in the introspection module.

Changes

  • Replaced // TODO (LG) functionally test this function with an actual test case.
  • Verified that providing an invalid declarations array (with an unknown class type) triggers the expected error message: Unrecognised model element "...".

Verification

  • Test: Added check message in constructor() case.
  • Status: All tests passed locally (npm test).

Signed-off-by: Harshit Kumar <10harshitkumar@gmail.com>
@23harshitkumar

Copy link
Copy Markdown
Contributor Author

@mttrbrts @ekarademir The PR is ready for a review!

@mttrbrts
mttrbrts merged commit 05c1050 into accordproject:main Feb 14, 2026
13 checks passed
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