Skip to content

E2E: improve error context in assertions#7281

Open
phyllis-sy-wu wants to merge 1 commit intopsyw-0413-E2E-one-time-authfrom
psyw-0413-E2E-improve-error-context-in-assertions
Open

E2E: improve error context in assertions#7281
phyllis-sy-wu wants to merge 1 commit intopsyw-0413-E2E-one-time-authfrom
psyw-0413-E2E-improve-error-context-in-assertions

Conversation

@phyllis-sy-wu
Copy link
Copy Markdown
Contributor

@phyllis-sy-wu phyllis-sy-wu commented Apr 13, 2026

WHY are these changes introduced?

When E2E tests fail, some assertions already had error context (e.g., build failed:\nstderr: ...) but others didn't, the error message only shows "Expected: 0, Received: 1" without the CLI output that caused the failure. This makes it hard to diagnose issues, especially in CI where you can't re-run interactively.

WHAT is this pull request doing?

Adds error context (stdout/stderr) to all expect(exitCode).toBe(0) assertions that were missing it.

Before:

expect(initResult.exitCode).toBe(0)

After:

expect(initResult.exitCode, `create-app failed:\nstdout: ${initResult.stdout}\nstderr: ${initResult.stderr}`).toBe(0)

Files changed: 6 test files — app-dev-server, app-scaffold, commands, smoke, smoke-pty

How to test your changes?

No behavior change — assertions only show the added context when a test fails.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing, so I've added a changelog entry with pnpm changeset add

Copy link
Copy Markdown
Contributor Author

phyllis-sy-wu commented Apr 13, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0413-E2E-improve-error-context-in-assertions branch from 94f4908 to d872975 Compare April 14, 2026 00:01
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0413-E2E-improve-error-context-in-assertions branch from d872975 to 13cf2b4 Compare April 14, 2026 16:48
@phyllis-sy-wu phyllis-sy-wu marked this pull request as ready for review April 14, 2026 16:52
@phyllis-sy-wu phyllis-sy-wu requested a review from a team as a code owner April 14, 2026 16:52
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0413-E2E-improve-error-context-in-assertions branch from 13cf2b4 to 3c85425 Compare April 14, 2026 16:59
@github-actions
Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/node-package-manager.d.ts
@@ -68,14 +68,6 @@ export declare function packageManagerFromUserAgent(env?: NodeJS.ProcessEnv): Pa
  * @returns The dependency manager
  */
 export declare function getPackageManager(fromDirectory: string): Promise<PackageManager>;
-/**
- * Builds the command and argv needed to execute a local binary using the package manager
- * detected from the provided directory or its ancestors.
- */
-export declare function packageManagerBinaryCommandForDirectory(fromDirectory: string, binary: string, ...binaryArgs: string[]): Promise<{
-    command: string;
-    args: string[];
-}>;
 interface InstallNPMDependenciesRecursivelyOptions {
     /**
      * The dependency manager to use to install the dependencies.

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