Skip to content

Fix failing test: TestLoad_NonExistentFile #3

@tapvt

Description

@tapvt

Problem

The test TestLoad_NonExistentFile in internal/config/config_test.go:328 is failing because it expects an os.IsNotExist error but gets nil instead.

Root Cause

The Load function tries multiple config file locations including the home directory .goshrc file. If any of these files exist, the function succeeds instead of returning the expected error.

Current Behavior

  • Test expects os.IsNotExist error when loading from non-existent directory
  • Function returns nil because it falls back to checking ~/.goshrc

Expected Fix

Either:

  1. Fix the test logic to account for fallback behavior, OR
  2. Modify the Load function to match the expected semantics

Files Affected

  • internal/config/config_test.go (line 328-336)
  • internal/config/config.go (Load function logic)

Priority

Critical - Failing tests block development workflow and CI/CD.

Reference

See TODO.md item #2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcriticalCritical issues that must be fixed immediatelytestingIssues related to tests and test coverage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions