Skip to content

test: rename integrate-ava package to integrate-vitest - #663

Merged
Boshen merged 1 commit into
mainfrom
chore/rename-integrate-vitest
Jul 4, 2026
Merged

Boshen merged 1 commit into
mainfrom
chore/rename-integrate-vitest

Conversation

@Boshen

@Boshen Boshen commented Jul 4, 2026

Copy link
Copy Markdown
Member

Follow-up to #659. That PR migrated the integrate-ava package from ava to vitest, leaving the package name/directory a misnomer.

Rename packages/integrate-ava → packages/integrate-vitest so it's named for what it integrates, consistent with the sibling integrate-module / integrate-module-bundler packages.

  • git mv of the directory (all files are pure renames; only the name field in package.json changes).
  • pnpm-lock.yaml: the importer key is renamed and moved to its sorted position — no dependency changes (pnpm install --frozen-lockfile passes).
  • The root --filter=integrate* test glob still matches, and the specs' relative paths (../../cli/dist, ../core) are unchanged (same directory depth).

pnpm test is green — integrate-vitest 9/9, plus integrate-module 21 and integrate-module-bundler 22.

The package migrated from ava to vitest in #659, so its name/directory was a misnomer. Rename to match what it integrates, consistent with the sibling integrate-module / integrate-module-bundler packages. The root `--filter=integrate*` test glob still matches.
@Boshen
Boshen merged commit 3713d0e into main Jul 4, 2026
21 checks passed
@Boshen
Boshen deleted the chore/rename-integrate-vitest branch July 4, 2026 09:40
Brooooooklyn added a commit that referenced this pull request Oct 26, 2026
<!-- claude-projects-attribution: {"github_login":"Brooooooklyn"} -->
_Requested by **Brooklyn** · [project
thread](https://claude.ai/code/project/chan_018s9RxRdtH424j2EhXdzV3N?thread=cmsg_018s9RxRdtH424j2EhXdzV3NQxbeR8Pt7qaqSQwoq9rEFo)_

<!-- routine:prune-tests:duplicate-smoke-tests -->

Before: two smoke tests could not fail for a reason no other test
catches. `integrate-vitest`'s `index.spec.ts > transform` repeats
integrate-module's `should resolve native addon`, and integrate-module's
`named import from json` asserts on a JSON import that Node loads
natively, so it passes even when oxc-node's JSON loader is broken.

After: both are gone. The two stdin TTY tests that alone catch a TTY
regression now say so in a comment, and a comment that pointed at the
deleted spec points at the surviving test. Only test files change.

How: each removal was defended by mutating `src/lib.rs` with the most
realistic regression it could catch, rebuilding the addon, running all
three JS suites, and reverting.

### Totals

- Files touched: 4, all tests (1 deleted, 1 case removed, 2
comment-only).
- Cases deleted: **2 of 643** JS cases (Vitest 600, integrate-module 21,
integrate-module-bundler 22); after: 641. The Rust `#[test]`s are
untouched.
- Cases merged: 0.
- Net lines: **−7** (+6 / −13).
- Runtime saved: 9.8 ms, the summed duration of the removed cases
(`transform` 9.72 ms, `named import from json` 0.09 ms).

### Removals

1. **`packages/integrate-vitest/__tests__/index.spec.ts > transform`**
(whole file)
- Class: duplicate. It calls `new
OxcTransformer(process.cwd()).transformAsync("foo.ts", …)` and checks
the CommonJS output; `packages/integrate-module/src/index.ts > should
resolve native addon` does the same with `"index.ts"`.
- Mutation M4: `src/lib.rs` `TransformTask::compute` emits `Module::Esm`
instead of `Module::CommonJS`. Fails both this test and `should resolve
native addon`.
   - Still covered by `should resolve native addon`.
2. **`packages/integrate-module/src/index.ts > named import from json`**
- Class: cannot fail when the product breaks. `import pkgJson from
"../package.json" with { type: "json" }` is loaded by Node itself, not
by oxc-node's JSON loader, and the test only reads `pkgJson.version`, a
default-export property.
- Mutation M5: `src/lib.rs` JSON loader emits `export default {}`. 9
`json-modules` / percent-encoded Vitest cases fail; all of
integrate-module, including this test, passes.
- Mutation M3: the JSON loader drops the synthesised named exports.
`json-modules.spec.ts > a named import` and `> a paths alias keeps the
synthesised named exports` fail; this test passes.
- The original feature (#20, named JSON imports) stays covered by those
two `json-modules.spec.ts` cases; `resolve package.json` keeps the
import itself exercised.

### Kept after defense

- `stdin-tty.spec.ts > CLI preserves TTY properties when stdin is a TTY`
and `> CLI with node directly preserves TTY (baseline comparison)`.
Mutation M6, `process.stdin.isTTY = false;` at the top of
`packages/core/register.mjs`, fails only these two across all three
suites (re-run on this branch). Each now carries a comment saying so.

### Case counts

| suite | before | after | delta |
|---|---|---|---|
| integrate-vitest (Vitest) | 600 (581 passed, 19 skipped) | 599 (580
passed, 19 skipped) | −1 |
| integrate-module | 21 | 20 | −1 |
| integrate-module-bundler | 22 | 22 | 0 |

0 failures before and after.

### What ran and what did not

- Ran: all three JS suites at `6d5376d` and on this branch; mutations
M3, M4, M5 (with an addon rebuild each) and M6, each reverted
afterwards; `vp check --no-fmt` (lint and type-check, clean on 99
files); `vp fmt --check` on the touched files (clean).
- `vp check` reports a formatting issue in `lerna.json`; it reports the
same at `6d5376d`, and this PR does not touch that file.
- Not run: the Rust tests, the bench, the WASI build, and other
platforms.

Ages: `transform` dates from before #663 (2026-07-04); `named import
from json` from #20 (2024-07-18). Neither is in a permission or security
suite.

To revert: `git revert 80ceedd`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01PxVsmvB9xfZKfVnUonY8kf)_

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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.

1 participant