-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http-client-java, add unit test to emitter (#5742)
Unit test with clientcore causes downstream module build failure. Here we are on JDK 17 (and current clientcore depends on 17), but downstream of autorest.java at 11. Add TypeScript unit tests. ![image](https://github.com/user-attachments/assets/78b12d8c-0825-4d1a-84f4-89ec54211057)
- Loading branch information
1 parent
22dc8c3
commit 67d284c
Showing
9 changed files
with
65 additions
and
175 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { describe, expect, it } from "vitest"; | ||
import { | ||
isStableApiVersion, | ||
pascalCase, | ||
removeClientSuffix, | ||
stringArrayContainsIgnoreCase, | ||
} from "../src/utils"; | ||
|
||
describe("utils", () => { | ||
it("isStableApiVersion", () => { | ||
expect(isStableApiVersion("2022-09-01")).toBe(true); | ||
expect(isStableApiVersion("2023-12-01-preview")).toBe(false); | ||
}); | ||
|
||
it("pascalCase", () => { | ||
expect(pascalCase("foo")).toBe("Foo"); | ||
expect(pascalCase("fooBar")).toBe("FooBar"); | ||
expect(pascalCase("FooBar")).toBe("FooBar"); | ||
expect(pascalCase("foo bar")).toBe("Foo bar"); | ||
}); | ||
|
||
it("stringArrayContainsIgnoreCase", () => { | ||
expect(stringArrayContainsIgnoreCase(["foo", "bar"], "foo")).toBe(true); | ||
expect(stringArrayContainsIgnoreCase(["foo", "bar"], "Bar")).toBe(true); | ||
expect(stringArrayContainsIgnoreCase(["foo", "bar"], "del")).toBe(false); | ||
}); | ||
|
||
it("removeClientSuffix", () => { | ||
expect(removeClientSuffix("FooClient")).toBe("Foo"); | ||
expect(removeClientSuffix("client")).toBe("client"); | ||
}); | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineConfig, mergeConfig } from "vitest/config"; | ||
import { defaultTypeSpecVitestConfig } from "../../../vitest.workspace.js"; | ||
|
||
export default mergeConfig( | ||
defaultTypeSpecVitestConfig, | ||
defineConfig({ | ||
test: { | ||
include: ["emitter/test/**/*.test.ts"], | ||
}, | ||
}), | ||
); |
This file contains 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
This file contains 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
151 changes: 0 additions & 151 deletions
151
...typespec/http/client/generator/core/template/ClientMethodSerializeItemValueCodeTests.java
This file was deleted.
Oops, something went wrong.
This file contains 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