Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .chronus/changes/add-test-case-2025-7-21-13-34-58.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: feature
packages:
- typespec-vscode
---

Add test case for TypeSpec Extension - 2
5 changes: 5 additions & 0 deletions packages/typespec-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,18 @@
"test:extension": "vitest run --root test/extension"
},
"devDependencies": {
"@nut-tree-fork/nut-js": "^4.2.6",
"@types/cross-spawn": "~6.0.6",
"@types/mocha": "^10.0.9",
"@types/node": "~24.0.3",
"@types/semver": "^7.5.8",
"@types/vscode": "~1.100.0",
"@types/which": "^3.0.4",
"@typespec/compiler": "workspace:^",
"@typespec/http": "workspace:^",
"@typespec/openapi": "workspace:^",
"@typespec/openapi3": "workspace:^",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also shouldn't have tests that depends on other things. This should be testing the ui in the most basic way not the compile or other functionality of those packages.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also shouldn't have tests that depends on other things. This should be testing the ui in the most basic way not the compile or other functionality of those packages.

"@typespec/http-client-js": "workspace:^",
"@typespec/internal-build-utils": "workspace:^",
"@vscode/test-electron": "^2.3.9",
"@vitest/coverage-v8": "^3.1.2",
Expand Down
30 changes: 30 additions & 0 deletions packages/typespec-vscode/temp/EmitTypespecProject/main.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import "@typespec/http";

using Http;
@service(#{ title: "Widget Service" })
namespace DemoService;

model Widget {
@path
id: string;

weight: int32;
color: "red" | "blue";
}

@error
model Error {
code: int32;
message: string;
}

@route("/widgets")
@tag("Widgets")
interface Widgets {
@get list(): Widget[] | Error;
@get read(@path id: string): Widget | Error;
@post create(...Widget): Widget | Error;
@patch update(...Widget): Widget | Error;
@delete delete(@path id: string): void | Error;
@route("{id}/analyze") @post analyze(@path id: string): string | Error;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
emit:
- "@typespec/http-client-java"
- "@typespec/openapi3"
- "@typespec/http-server-csharp"
- "@typespec/http-client-python"
- "@typespec/http-client-js"
- "@typespec/http-client-csharp"
- "@typespec/http-server-js"
options:
"@typespec/http-client-java":
emitter-output-dir: "{output-dir}/{emitter-name}"
"@typespec/openapi3":
emitter-output-dir: "{output-dir}/{emitter-name}"
"@typespec/http-server-csharp":
emitter-output-dir: "{output-dir}/{emitter-name}"
"@typespec/http-client-python":
emitter-output-dir: "{output-dir}/{emitter-name}"
"@typespec/http-client-js":
emitter-output-dir: "{output-dir}/{emitter-name}"
"@typespec/http-client-csharp":
emitter-output-dir: "{output-dir}/{emitter-name}"
"@typespec/http-server-js":
emitter-output-dir: "{output-dir}/{emitter-name}"
Loading
Loading