fix(ci): route scope-isolation issue85 test to e2e suite - #99
Merged
Conversation
The test file was named `scope-isolation-e2e-issue85.test.ts`, which does not match the e2e config's `*-e2e.test.ts` glob, so it was picked up by the unit test step (`vitest run --coverage`). That step runs before `build`, so `dist/index.js` is absent and the test aborts with "CLI binary not found", failing CI on main. Move it into `src/__tests__/e2e/` (which the e2e config includes and the unit config excludes) and fix the ROOT path for the deeper directory. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mainCI 一直在 Unit tests with coverage 这步失败,报错CLI binary not found at .../dist/index.js。src/__tests__/scope-isolation-e2e-issue85.test.ts是个 e2e 测试(会 spawn 真实 CLI 二进制),但文件名结尾是-e2e-issue85.test.ts,不匹配 e2e 配置的*-e2e.test.tsglob,于是被单元测试阶段捡走执行。而单元测试跑在build之前,dist/index.js尚不存在,测试直接中止。src/__tests__/e2e/(该目录被vitest.e2e.config.tsinclude、被vitest.config.tsexclude),并修正因目录加深导致的ROOT相对路径(..增加一层)。Test plan
npx vitest list --config vitest.config.ts不再包含该测试(已从单元集中移除)npx vitest list --config vitest.e2e.config.ts正确收录该测试(7 个用例)npm run build后运行该 e2e 测试:7 passedMade with Cursor