@observe command can now make test cases #2282
Open
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.
This pull request introduces enhancements to the
observe-command
andexplain-command
functionality, focusing on improved test case suggestions, handling of unclosed XML tags, and better flexibility in user options. It also includes utility additions and test coverage for new functionality.Enhancements to
observe-command
:[[1]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-453f47dc0b3f8349e806c45215de8b8589cdab994445a033872a11f6dae2d98cR160-R162)
,[[2]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-453f47dc0b3f8349e806c45215de8b8589cdab994445a033872a11f6dae2d98cR193-R270)
,[[3]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-453f47dc0b3f8349e806c45215de8b8589cdab994445a033872a11f6dae2d98cL189-R296)
,[[4]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-453f47dc0b3f8349e806c45215de8b8589cdab994445a033872a11f6dae2d98cL225-R332)
)suggestTestCase
to handle the generation of test case suggestions usingExplainCommand
. ([packages/navie/src/commands/observe-command.tsR193-R270](https://github.com/getappmap/appmap-js/pull/2282/files#diff-453f47dc0b3f8349e806c45215de8b8589cdab994445a033872a11f6dae2d98cR193-R270)
)RelevantTest
schema to support nullable and transformed fields, and added asuggestedTest
field for test case suggestions. ([[1]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-453f47dc0b3f8349e806c45215de8b8589cdab994445a033872a11f6dae2d98cR3-R60)
,[[2]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-453f47dc0b3f8349e806c45215de8b8589cdab994445a033872a11f6dae2d98cR72-R80)
)Enhancements to
explain-command
:classifierService
optional and restrictedagentSelectionService
to specific properties, improving flexibility and type safety. ([[1]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-8fc64b3b138b643930110c42f044e061bdc178fb607f1fbcf34bd30b7b13e95cL37-R41)
,[[2]](https://github.com/getappmap/appmap-js/pull/2282/files#diff-8fc64b3b138b643930110c42f044e061bdc178fb607f1fbcf34bd30b7b13e95cL55-R58)
)Utility additions:
closingTags
function to detect and append missing XML closing tags, ensuring well-formed output. ([packages/navie/src/lib/closing-tags.tsR1-R33](https://github.com/getappmap/appmap-js/pull/2282/files#diff-192232aef104a6ceddd59ee60925fa896ff165740e45f82e81195e1232e91412R1-R33)
)replaceStream
utility to replace specific patterns in a stream with asynchronous replacements. ([packages/navie/src/lib/replace-stream.tsR1-R35](https://github.com/getappmap/appmap-js/pull/2282/files#diff-103e6121f36f41a08a0e12704ff43d2930a244b4b4e63d77f5a84bb23dbf5e01R1-R35)
)Improvements to
InteractionHistory
:clone
method to create shallow copies of interaction history for isolated modifications. ([packages/navie/src/interaction-history.tsR319-R333](https://github.com/getappmap/appmap-js/pull/2282/files#diff-ed85c6d6714ad90002f856d93a39906e6cbd3135d24e1b4bb445c8360a9df27cR319-R333)
)Test coverage:
closingTags
utility to validate its behavior with various tag scenarios. ([packages/navie/test/lib/closing-tags.spec.tsR1-R35](https://github.com/getappmap/appmap-js/pull/2282/files#diff-6e1aad13709c90f0f865d6437be1b34d8931838f059ea792158b095afc9e2c26R1-R35)
)