feat : Convert check scripts to Vitest in place - #133
Open
dawgdevv wants to merge 8 commits into
Open
Conversation
- Updated `package.json` to replace existing test scripts with Vitest commands. - Added `vitest.config.ts` for Vitest configuration. - Excluded `tests` and `node_modules` from build in `tsconfig.build.json`. - Included `tests/**/*.ts` in `tsconfig.json` for TypeScript compilation. - Removed outdated test scripts: `check-graph-view.js`, `check-install-options.js`, `check-proposal-validate.js`, `check-repo-context.js`, and `check-transcript-bundle.js`. - Introduced new integration tests for graph view, install options, proposal validation, repo context detection, and transcript bundling.
Brings back updated check scripts from main (Autoloops#100, Autoloops#105, Autoloops#107, Autoloops#102) alongside new Vitest tests so changes can be ported and verified.
…tests - Removed deprecated check scripts for BM25 tokenizer, install options, proposal validation, and transcript bundling. - Updated OpenCode module to import HookInput from types instead of hooks. - Enhanced install options tests to verify OpenCode's support for hooks and auto memory updates. - Improved transcript bundling tests for OpenCode to ensure proper handling of system instructions.
…all options, proposal validation, repo context, and transcript bundling - Introduced new test scripts to validate BM25 tokenization for various naming conventions. - Added checks for graph view rendering and component initialization. - Implemented tests for install options, ensuring correct behavior for hooks and auto memory updates. - Validated proposal normalization and edge cases in proposal validation. - Established repo context detection tests for different repository setups. - Created transcript bundling tests for multiple platforms, ensuring proper handling of session data and instructions.
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.
Convert check scripts to Vitest in place
Summary
Converts all 7
scripts/check-*.jscheck scripts from plainnode:assertscripts to Vitest test suites in place same files, same directory,
same filenames. This gives the reviewer a clean line-by-line diff showing
each
assert.*call being replaced by itsexpect()equivalent.Why in place?
The previous approach (delete old scripts + add new
tests/integration/*.test.tsfiles) made the PR unreviewable —
What changed
Each
scripts/check-*.jsfile was mechanically converted:describe()/test()blocksassert.equal(a, b)expect(a).toBe(b)assert.deepEqual(a, b)expect(a).toEqual(b)assert.match(a, /re/)expect(a).toMatch(/re/)assert.doesNotMatch(a, /re/)expect(a).not.toMatch(/re/)assert.ok(a)expect(a).toBe(true)assert.notEqual(a, b)expect(a).not.toBe(b)assert.throws(fn, /re/)expect(fn).toThrow(/re/)assert.doesNotThrow(fn)expect(fn).not.toThrow()await import()beforeAll(async () => ...)mkdtempSyncmkdtempSync(better isolation)console.log("...: ok")No test logic was changed. Every assertion, input data, regex pattern,
and expected value is identical to the previous implementation.
Files modified (7 scripts)
check-transcript-bundle.jscheck-repo-context.jscheck-install-options.jscheck-graph-view.jscheck-proposal-validate.jscheck-bm25-tokenizer.jscheck-anchor-drift.jsInfrastructure changes
vitest.config.ts— new, targetsscripts/check-*.js, excludescheck-node-version.jspackage.json—testnow runsnpm run build && vitest run; addedtest:fast,test:watch,test:coveragepackage.json— addedvitestand@vitest/coverage-v8to devDependenciesPre-existing build fix
While merging
origin/main, discovered a pre-existing build breakage:libs/install/platforms/opencode.tsimportedHookInputfrom../../hooks/hook-input.jsbut commit #95 movedHookInputto../../hooks/types.tswithout re-exporting. Fixed the import to match the pattern used inopenhands.ts:Verification
Test Files 7 passed (7)
Tests 35 passed (35)
Duration 3.16s