Skip to content

fix(config): use defaults when .testyrc.json is missing for explicit files - #440

Merged
ngarbezza merged 1 commit into
mainfrom
claude/error-439-6f5fb3
Oct 13, 2026
Merged

ngarbezza merged 1 commit into
mainfrom
claude/error-439-6f5fb3

Conversation

@ngarbezza

Copy link
Copy Markdown
Owner

Qué

Corrige #439: npx testy some_test.js desde un directorio sin .testyrc.json fallaba con el error genérico "unexpected error" (ENOENT).

Por qué pasaba

Configuration.current() tenía un fallback a {} si no existía el archivo de usuario, pero Configuration.withConfiguration() (el camino usado cuando se pasan archivos por CLI) leía .testyrc.json sin ese fallback.

Cambio

  • Ambos métodos comparten ahora #userConfigurationFile(), que devuelve {} si el archivo no se puede leer; current() delega en withConfiguration({}).
  • Test end-to-end que ejecuta bin/testy_cli.js sobre un archivo en un directorio temporal sin .testyrc.json (falla antes del fix, pasa después).
  • Entrada en CHANGELOG (Unreleased → Fixed).

Closes #439

🤖 Generated with Claude Code

…explicit files

Configuration.withConfiguration (used when test files are passed on the CLI)
read .testyrc.json without the fallback that Configuration.current() had, so
running a single file from a directory without that file crashed through the
generic unexpected-error path. Both now share the same optional read.

Closes #439
@ngarbezza
ngarbezza merged commit 8c48967 into main Oct 13, 2026
6 checks passed
@ngarbezza
ngarbezza deleted the claude/error-439-6f5fb3 branch October 13, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running a single test file without a .testyrc.json fails instead of using defaults

1 participant