File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
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
+ } ) ;
You can’t perform that action at this time.
0 commit comments