Context
We now have two converter plugins (Express, Flask) with zero automated tests. Both pass CI because there are no *_test.go files — go test ./... has nothing to run.
The Flask converter was merged in #1 based on manual testing. We need proper test coverage before adding more converters.
What's needed
internal/convert/convert_test.go (shared)
- Test
routeToHandlerName() with edge cases (nested paths, params, hyphens)
- Test
contains() helper
- Test
generateFromScan() produces valid Go that compiles
internal/convert/express_test.go
- Create a temp directory with a minimal Express app (app.js, package.json, .env.example)
- Run
scanExpress() and assert: route count, methods, DB type, env vars, models
- Verify generated output compiles:
go build -o /dev/null .
internal/convert/flask_test.go
- Create a temp directory with a minimal Flask app (app.py, requirements.txt, .env.example)
- Run
scanFlask() and assert: route count, methods, DB type, env vars, models
- Test
flaskPathToStandard(): <int:id> → :id, <string:name> → :name, <id> → :id
- Test
extractMethods(): empty → ["GET"], 'GET', 'POST' → ["GET", "POST"]
- Verify generated output compiles
Test fixtures
internal/convert/testdata/express/ — minimal Express app
internal/convert/testdata/flask/ — minimal Flask app
CI
go test ./... already runs in CI — just needs test files to exist
- Add
-race flag for race condition detection
- Add
-coverprofile for coverage reporting
Acceptance criteria
Context
We now have two converter plugins (Express, Flask) with zero automated tests. Both pass CI because there are no
*_test.gofiles —go test ./...has nothing to run.The Flask converter was merged in #1 based on manual testing. We need proper test coverage before adding more converters.
What's needed
internal/convert/convert_test.go(shared)routeToHandlerName()with edge cases (nested paths, params, hyphens)contains()helpergenerateFromScan()produces valid Go that compilesinternal/convert/express_test.goscanExpress()and assert: route count, methods, DB type, env vars, modelsgo build -o /dev/null .internal/convert/flask_test.goscanFlask()and assert: route count, methods, DB type, env vars, modelsflaskPathToStandard():<int:id>→:id,<string:name>→:name,<id>→:idextractMethods(): empty →["GET"],'GET', 'POST'→["GET", "POST"]Test fixtures
internal/convert/testdata/express/— minimal Express appinternal/convert/testdata/flask/— minimal Flask appCI
go test ./...already runs in CI — just needs test files to exist-raceflag for race condition detection-coverprofilefor coverage reportingAcceptance criteria
go test ./...actually tests something