Skip to content

Commit c30cf4d

Browse files
committed
feat: test
1 parent 76fd1b7 commit c30cf4d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import * as fs from "fs";
2+
import * as path from "path";
3+
4+
import * as Templates from "../../src/templates";
5+
import type * as Types from "../../src/types";
6+
import { CodeGenerator } from "../../src";
7+
8+
9+
describe("raw-json-generate", () => {
10+
test("api.test.domain", () => {
11+
const generateCode = JSON.parse(
12+
fs.readFileSync(path.join(__dirname, "../code/parameter/api.test.domain.json"), { encoding: "utf-8" })
13+
);
14+
15+
const codeGenerator = new CodeGenerator(generateCode);
16+
17+
const apiClientGeneratorTemplate: Types.CodeGenerator.CustomGenerator<Templates.ApiClient.Option> = {
18+
generator: Templates.ApiClient.generator,
19+
option: {},
20+
};
21+
22+
const code = codeGenerator.generateTypeDefinition([
23+
codeGenerator.getAdditionalTypeDefinitionCustomCodeGenerator(),
24+
apiClientGeneratorTemplate,
25+
]);
26+
27+
expect(code).toMatchSnapshot();
28+
});
29+
});

0 commit comments

Comments
 (0)