Repository navigation
test(Opencode): Even more tests of potential inputs for the /associate command including error checking and in project verification - #30
Merged
Conversation
carnegiedude
added this pull request to stack #31
October 8, 2026 22:27
carnegiedude
force-pushed
the
npeters/associate-tests2
branch
from
October 8, 2026 22:28
b12f830 to
b707d4a
Compare
jannalu
reviewed
Oct 9, 2026
| }) | ||
| .pipe(Effect.exit) | ||
|
|
||
| expect(Exit.isFailure(exit)).toBe(true) |
Contributor
There was a problem hiding this comment.
Hi Nate, there are multiple error assertions in the symlink rejection tests (another starts at line 2174). Maybe these could be grouped together in a helper to reduce duplication and make future validation tests easier to add. Great job !
Contributor
|
Other than Janna's comments, I think this looks well. Just to reiterate, I do think having the helpers can help you with testing in the regard that testing from lecture must be deterministic + side-effect free. |
…r handling, acceptance of files only inside the project and working, and malformed quotes. They also test the visibility of the /associate command in the command list and prevents override of /associate
carnegiedude
force-pushed
the
npeters/associate-tests2
branch
from
October 9, 2026 05:47
b707d4a to
8a2b07d
Compare
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.
Issue for this PR
#13
Type of change
What does this PR do?
This PR adds 7 additional tests of the /associate function.
They cover the following cases:
Single quoted paths with surrounding whitespace
The Session Event Error is validated
Built in command metadata and arguments are present
In-project files are accepted
Out-of-project files are rejected
If the link is broken the file is rejected
Other potential associate command do not inherit from /associate
How did you verify your code works?
From packages/opencode I ran:
bun test/test/session/prompt.test.ts --test-name-pattern associate
bun typecheck
The first command resulted in 17 passing tests with 60 expect calls in one file.
The type check did not raise any errors.
Screenshots / recordings
Not applicable. This PR contains tests only.
Checklist