Skip to content

test: judge discovered paths from the workspace root, not the absolute path - #182

Merged
Shinrai merged 1 commit into
nextfrom
test/discovery-dist-segment
Nov 14, 2026
Merged

Shinrai merged 1 commit into
nextfrom
test/discovery-dist-segment

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

No bug fixes

📦 Dependencies

No dependency updates

🔧 Other Changes

  • test: judge discovered paths from the workspace root, not the absolute path (1ae506a)
👥 Contributors

…e path

The discovery test checked path.includes("dist/") on absolute paths, so it failed whenever the checkout itself sat under a folder whose name ends in dist. It now looks at each path's folders relative to the workspace. The include-folder walk never visits dist/, so a whole-project walk is added to actually exercise the dist exclusion.
@cldmv-bot cldmv-bot Bot added ! test → next v4 flow: test contributor PR targeting the next integration branch area: tests Touches test files, fixtures, or test infrastructure labels Nov 8, 2026
@Shinrai
Shinrai merged commit 908f3a7 into next Nov 14, 2026
31 checks passed
@cldmv-bot
cldmv-bot Bot deleted the test/discovery-dist-segment branch November 14, 2026 18:53
cldmv-bot Bot added a commit that referenced this pull request Nov 15, 2026
# `@cldmv/fix-headers` v2.2.7 Changelog

**Release Date**: November 2026
**Release Type**: Patch
**Branch**: `release/2.2.7`

---

## Overview

Version 2.2.7 changes how the package is tested, not what it does. Nothing under `src/` changed, so header handling, the `fixHeaders` API, the CLI and the published `dist/` behave exactly as in v2.2.6.

The test suite now really runs against `src/` through the `fix-headers-dev` condition (the old config never passed it to the test workers), the same suite also runs against the built `dist/` with `npm run test:dist`, and one discovery test no longer fails when the checkout sits under a folder named `dist`. The rest is a `vitest` 5.1.0 bump and the `sync-release-notes` workflow.

---

## 🧪 Tests

### The `fix-headers-dev` condition reaches the test workers ([#179](#179))

The vitest config passed the condition through `test.nodeOptions`, which isn't a Vitest option, so the workers never got it. It now uses `devCondition()` from `@cldmv/configs`, which sets `resolve.conditions`, `ssr.resolve.conditions` and the workers' `execArgv` from the package's own `package.json`.

### `npm run test:dist` runs the suite against the build ([#181](#181))

The tests import the package by name (`@cldmv/fix-headers`) instead of `../src/index.mjs`. `npm run test:dist` builds the package and runs the suite with `--mode=dist`, which leaves the `fix-headers-dev` condition off, so those imports load `dist/`. A new `tests/resolve.test.vitest.mjs` checks that each run loaded the tree it meant to. `npm test` and `ci:coverage` now include the `dist/` run.

### Discovery test judges paths from the workspace root ([#182](#182))

The include/exclude discovery test checked `path.includes("dist/")` on absolute paths, so it failed whenever the checkout itself sat under a folder whose name ends in `dist`. It now looks at each path's folders relative to the workspace. Because the include-folder walk never visits `dist/`, the test also does a whole-project walk with only `excludeFolders`, so the `dist` exclusion is actually exercised.

## 🔧 CI & tooling

- Added the v4 `sync-release-notes` workflow, which keeps GitHub Release pages in step with the files in `docs/changelog/` and reports draft releases and missing tags ([#187](#187)).

## 📚 Documentation

- **NEW:** [docs/changelog/v2/v2.2.7.md](https://github.com/CLDMV/fix-headers/blob/v2.2.7/docs/changelog/v2/v2.2.7.md): this changelog.
- README: the development requirements mention `npm test` (against `src/`) and `npm run test:dist` (against `dist/`) ([#181](#181)).
- README What's New promoted to v2.2.7.

## 🔧 Dependencies

Development only:

- `vitest` and `@vitest/coverage-v8` 5.0.5 → 5.1.0 ([#183](#183)).
- `@cldmv/configs` `^1.2.4` → `^1.4.0`, for `devCondition()` ([#179](#179)).

---

## Upgrade notes

- No breaking changes; drop-in for v2.2.6. No library code changed, and header output is identical.



<details>
<summary>👥 Contributors</summary>

- @Shinrai

</details>

---

<!-- coverage-start -->

![coverage](https://img.shields.io/badge/coverage-99.6%25-brightgreen?style=for-the-badge&logo=vitest&logoColor=white)

| Metric | Coverage |
|--------|----------|
| Statements | 99.9% |
| Branches   | 98.8% |
| Functions  | 100.0% |
| Lines      | 99.9% |

*Avg: **99.6%** · `13da7df` · Node lts/**

<!-- coverage-end -->

<!-- co-authors -->

Co-authored-by: Shinrai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Touches test files, fixtures, or test infrastructure ! test → next v4 flow: test contributor PR targeting the next integration branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant