-
Notifications
You must be signed in to change notification settings - Fork 0
Add unit test suite (vitest) #1
Copy link
Copy link
Open
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededtestingTest infrastructureTest infrastructure
Description
Context
pulser currently has zero tests. No test runner, no test files, no test framework in devDependencies. This is the single most impactful contribution you can make.
What to do
- Install
vitestas a devDependency - Add
"test": "vitest run"topackage.jsonscripts - Write initial tests for:
src/eval/assertions.ts— 5 assertion types (contains,not-contains,min-length,max-length,matches), all pure functionssrc/classifier.ts— skill type classification logic, pure scoring
Why these files first
Both are pure functions with clear inputs and outputs — no filesystem access, no side effects. Perfect for a first test suite.
Example
import { checkAssertion } from './assertions';
test('contains assertion passes when text includes substring', () => {
expect(checkAssertion({ contains: 'hello' }, 'hello world')).toBe(true);
});
test('min-length assertion fails for short text', () => {
expect(checkAssertion({ 'min-length': 50 }, 'short')).toBe(false);
});Files to modify
package.json(add vitest, test script)- New:
src/eval/assertions.test.ts - New:
src/classifier.test.ts
Difficulty: Easy
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededtestingTest infrastructureTest infrastructure