Fastify best practices skill
93
97%
Does it follow best practices?
Impact
85%
1.37xAverage score across 4 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent uses Fastify's inject() method for HTTP simulation, imports from node:test rather than a third-party framework, uses the node:test assertion API (t.assert.*), and follows the test factory pattern with logging disabled.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses app.inject()",
"description": "HTTP requests in tests are made via `app.inject(...)` — does NOT use `supertest`, `axios`, `node-fetch`, `fetch`, or start a real HTTP server with `app.listen()`",
"max_score": 20
},
{
"name": "Imports from node:test",
"description": "Test file imports `describe`, `it`, `before`, `after` (or `beforeEach`/`afterEach`) from `'node:test'` — does NOT import from `jest`, `mocha`, `vitest`, or `tap`",
"max_score": 20
},
{
"name": "t.assert assertion style",
"description": "Assertions use `t.assert.equal(...)` or `t.assert.ok(...)` (node:test style) — does NOT use `expect(...).toBe(...)`, `assert.strictEqual(...)` from the node:assert module directly, or Jest matchers",
"max_score": 15
},
{
"name": "Logger disabled in tests",
"description": "The Fastify app built for tests is initialized with `logger: false` (either directly or via a helper function) to suppress log output during test runs",
"max_score": 10
},
{
"name": "before/after lifecycle",
"description": "Tests use `before()` to build/start the app and `after()` to call `app.close()` for proper cleanup",
"max_score": 15
},
{
"name": "node --test script",
"description": "The `test` script in `package.json` uses `node --test` (not `jest`, `mocha`, `vitest`, or any other test runner command)",
"max_score": 10
},
{
"name": "response.json() usage",
"description": "Response bodies are parsed using `response.json()` (Fastify inject response method) rather than `JSON.parse(response.body)` or `response.payload`",
"max_score": 10
}
]
}