Skip to content

[BUG] Test failure: environment variable case sensitivity on Windows #229

@albahrani

Description

@albahrani

Bug Description

The memAgent test should handle case-insensitive environment variable names fails on Windows environments.

The test should handle case-insensitive environment variable names in src/core/brain/memAgent/__test__/loader.test.ts fails on Windows due to environment variable case sensitivity differences. On Windows, environment variable names are case-insensitive, while on Unix-like systems they are case-sensitive. This causes the test to expect "lowercase" but receive "uppercase" on Windows.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Run the test suite on a Windows machine.
  2. Observe the failure in should handle case-insensitive environment variable names in loader.test.ts.

Expected Behavior

The test should pass on all platforms, regardless of environment variable case sensitivity.

Actual Behavior

On Windows, the test fails with:

AssertionError: expected 'uppercase' to be 'lowercase' // Object.is equality
Expected: "lowercase"
Received: "uppercase"

Screenshots

N/A

Environment Information

OS: Windows 11
Browser: N/A
Version: 0.3.0
Node.js version: v24.5.0

Logs and Error Messages

Please provide any relevant logs, error messages, or console output:

FAIL  src/core/brain/memAgent/__test__/loader.test.ts > Loader > Environment Variable Expansion > should handle case-insensitive environment variable names
AssertionError: expected 'uppercase' to be 'lowercase' // Object.is equality
Expected: "lowercase"
Received: "uppercase"

Additional Context

Does this test actually make sense on platforms with case-insensitive environment variables (e.g., Windows)?

Possible Solution

  • Update the test to skip or adjust its expectations on platforms where environment variables are case-insensitive (such as Windows).
  • Alternatively, refactor the loader logic to normalize environment variable keys for cross-platform compatibility.
  • Or, document that this behavior is platform-dependent and exclude the test from Windows runs.

Checklist

  • I have searched for similar issues before creating this one
  • I have provided all the requested information above
  • I have tested this on the latest version

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions