1
1
{# @pebvariable name="imports" type="java.util.List<java.util.Map<String, String>>" #}
2
2
{# @pebvariable name="operations" type="org.openapitools.codegen.model.OperationMap" #}
3
+ {# @pebvariable name="authMethods" type="java.util.ArrayList<org.openapitools.codegen.CodegenSecurity>" -#}
3
4
import { {{operations.classname}} } from "../../api";
4
5
5
6
{% for import in imports -%}
@@ -35,10 +36,10 @@ const channel_access_token = "test_channel_access_token";
35
36
{% endif -%}
36
37
{% endmacro %}
37
38
38
-
39
- describe("{{operations.classname}}", () => {
40
- {% for op in operations.operation % }
41
- it("{{op.nickname}}", async () => {
39
+ {% macro renderTest(operations, op, authMethods, withHttpInfo) %}
40
+ {# @pebvariable name="withHttpInfo" type="java.lang.Boolean" #}
41
+ {# @pebvariable name="op" type="org.openapitools.codegen.CodegenOperation" # }
42
+ it("{{op.nickname}}{% if withHttpInfo %}WithHttpInfo{% endif %} ", async () => {
42
43
let requestCount = 0;
43
44
44
45
const server = createServer((req, res) => {
@@ -101,7 +102,7 @@ describe("{{operations.classname}}", () => {
101
102
baseURL: `http://localhost:${String(serverAddress.port)}/`
102
103
});
103
104
104
- const res = await client.{{op.nickname}}(
105
+ const res = await client.{{op.nickname}}{% if withHttpInfo %}WithHttpInfo{% endif %} (
105
106
{% for param in op.allParams -%}
106
107
{{ paramDummyValue(param) }}
107
108
{% endfor %}
@@ -111,5 +112,11 @@ describe("{{operations.classname}}", () => {
111
112
server.close();
112
113
});
113
114
115
+ {% endmacro %}
116
+
117
+ describe("{{operations.classname}}", () => {
118
+ {% for op in operations.operation %}
119
+ {{ renderTest(operations, op, authMethods, true) }}
120
+ {{ renderTest(operations, op, authMethods, false) }}
114
121
{% endfor %}{# op #}
115
122
});
0 commit comments