Skip to content

fix: improve error message when createTester base lacks package.json#10033

Open
jaxx2104 wants to merge 2 commits intomicrosoft:mainfrom
jaxx2104:fix/create-tester-error-message
Open

fix: improve error message when createTester base lacks package.json#10033
jaxx2104 wants to merge 2 commits intomicrosoft:mainfrom
jaxx2104:fix/create-tester-error-message

Conversation

@jaxx2104
Copy link

Fixes #9597

Summary

  • When createTester is called with a base directory that does not contain a package.json, the error was a generic file-not-found. This change catches the error and throws a clear, actionable message indicating the first argument must be the library root directory.
  • Adds a corresponding test case.

Test plan

  • Added unit test that verifies a descriptive error is thrown when package.json is missing from the base directory.

…kage.json

Previously, createTester would throw a generic file-not-found error when
the base directory did not contain a package.json. This adds a clear,
actionable error message indicating that the first argument must be the
library root directory.
@jaxx2104
Copy link
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler:core Issues for @typespec/compiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

createTester should validate first argument resolve to library root

1 participant