Skip to content

Commit d0f4f2f

Browse files
nizosclaude
andcommitted
refactor(jest): improve test readability with named parameters
Extract undefined values and inline objects into named variables to make the test code more self-documenting and clarify parameter purposes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1c64147 commit d0f4f2f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

reporters/jest/src/JestReporter.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,18 @@ describe('JestReporter', () => {
3131

3232
it('accepts Storage instance in reporterOptions', () => {
3333
const storage = new MemoryStorage()
34+
const globalConfig = undefined
3435
const reporterOptions = { storage }
35-
const reporter = new JestReporter(undefined, reporterOptions)
36+
const reporter = new JestReporter(globalConfig, reporterOptions)
3637
expect(reporter['storage']).toBe(storage)
3738
})
3839

3940
it('accepts projectRoot string in reporterOptions', () => {
4041
const rootPath = '/some/project/root'
42+
const globalConfig = undefined
4143
const reporterOptions = { projectRoot: rootPath }
42-
const reporter = new JestReporter(undefined, reporterOptions)
43-
expect(reporter['storage']).toBeInstanceOf(FileStorage)
44+
const reporter = new JestReporter(globalConfig, reporterOptions)
45+
4446
// Verify the storage is configured with the correct path
4547
const fileStorage = reporter['storage'] as FileStorage
4648
const config = fileStorage['config'] as TDDConfig
@@ -282,7 +284,9 @@ describe('JestReporter', () => {
282284
// Test setup helper function
283285
function setupJestReporter() {
284286
const storage = new MemoryStorage()
285-
const reporter = new JestReporter(undefined, { storage })
287+
const globalConfig = undefined
288+
const reporterOptions = { storage }
289+
const reporter = new JestReporter(globalConfig, reporterOptions)
286290

287291
// Helper to get parsed test data
288292
const getParsedData = async () => {

0 commit comments

Comments
 (0)