The config-priority checks in test-cli-config.ts pass even when TOML loses, because they ignore the exit code and look for a bare number

Closed Beginner friendly
#1,714 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #1858 by @frostney — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
testing

Research direction

The two config-precedence checks live in scripts/test-cli-config.ts. Read how they run the runner with .nothrow() and match output lines that equal 1 or 61. Change them to assert exit code 0 and check a value no diagnostic prints alone, such as a string printed via --print. Done when the checks fail if the TOML config loses.

Written by the indexing model from the issue text.

Description

internal

Summary

#1644 (interpreter-removal stack, layer 1) rewrote two config-precedence checks in scripts/test-cli-config.ts. They used to tell the files apart by the removed mode setting; now they set compat-asi (true in goccia.toml, false in goccia.json/goccia.json5) and run a script that only parses with ASI (const x = 1\nx\n, and const x = 61\nx\n for --config=<dir>).

Both checks run the runner with .nothrow() and accept any output line that is exactly 1 / 61. If TOML loses, the parse fails, and a diagnostic's source excerpt can still contain a line that is exactly 1 or 61. The test then passes with a non-zero exit.

Expected

Both checks assert exit code 0 and look for a value no diagnostic prints alone on a line, e.g. a string result such as "toml-wins" via --print. CodeRabbit raised this on #1644 (comment 4290055433). It's deferred here so the reviewed bottom layer of the stack doesn't need another review cycle.

[!NOTE]
Created on behalf of @frostney using Claude Opus 5.5.

Dominant language
Pascal
Stars
20
Forks
6
Avg merge
21h 36m
Merged PRs (30d)
307

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from frostney/GocciaScript

All issues in frostney/GocciaScript

Similar issues

More Testing & QA issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.