mmt-mcp 1.42.2-pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/README.md +22 -0
  2. package/dist/examples/README.md +19 -0
  3. package/dist/examples/ai/golden_smoke/README.md +8 -0
  4. package/dist/examples/ai/golden_smoke/apis/echo.mmt +12 -0
  5. package/dist/examples/ai/golden_smoke/tests/echo-smoke.mmt +18 -0
  6. package/dist/examples/basic/01_simple_api/README.md +38 -0
  7. package/dist/examples/basic/01_simple_api/get_json.mmt +6 -0
  8. package/dist/examples/basic/01_simple_api/post_echo_json_body.mmt +13 -0
  9. package/dist/examples/basic/01_simple_api/post_echo_yaml_body.mmt +11 -0
  10. package/dist/examples/basic/02_simple_test/README.md +35 -0
  11. package/dist/examples/basic/02_simple_test/echo_test.mmt +12 -0
  12. package/dist/examples/basic/03_environment_variables/README.md +40 -0
  13. package/dist/examples/basic/03_environment_variables/get_json.mmt +6 -0
  14. package/dist/examples/basic/03_environment_variables/multimeter.mmt +3 -0
  15. package/dist/examples/basic/04_basic_suite/README.md +33 -0
  16. package/dist/examples/basic/04_basic_suite/suite.mmt +6 -0
  17. package/dist/examples/basic/04_basic_suite/tests/get_status_test.mmt +9 -0
  18. package/dist/examples/basic/04_basic_suite/tests/post_echo_test.mmt +12 -0
  19. package/dist/examples/basic/05_basic_documentation/README.md +24 -0
  20. package/dist/examples/basic/05_basic_documentation/api/get_user.mmt +12 -0
  21. package/dist/examples/basic/05_basic_documentation/document.mmt +4 -0
  22. package/dist/examples/examples-index.json +1559 -0
  23. package/dist/examples/intermediate/01_api_inputs_outputs/README.md +46 -0
  24. package/dist/examples/intermediate/01_api_inputs_outputs/get_dot_notation.mmt +14 -0
  25. package/dist/examples/intermediate/01_api_inputs_outputs/get_with_outputs.mmt +10 -0
  26. package/dist/examples/intermediate/01_api_inputs_outputs/post_regex_outputs.mmt +24 -0
  27. package/dist/examples/intermediate/01_api_inputs_outputs/post_with_inputs_outputs.mmt +20 -0
  28. package/dist/examples/intermediate/02_websocket/README.md +44 -0
  29. package/dist/examples/intermediate/02_websocket/ws_echo.mmt +11 -0
  30. package/dist/examples/intermediate/02_websocket/ws_json_echo.mmt +16 -0
  31. package/dist/examples/intermediate/03_graphql/README.md +10 -0
  32. package/dist/examples/intermediate/03_graphql/graphql_query.mmt +16 -0
  33. package/dist/examples/intermediate/03_graphql/graphql_variables.mmt +25 -0
  34. package/dist/examples/intermediate/04_grpc/README.md +10 -0
  35. package/dist/examples/intermediate/04_grpc/grpc_server_stream.mmt +15 -0
  36. package/dist/examples/intermediate/04_grpc/grpc_unary.mmt +13 -0
  37. package/dist/examples/intermediate/05_api_documentation/README.md +33 -0
  38. package/dist/examples/intermediate/05_api_documentation/api/get_users.mmt +13 -0
  39. package/dist/examples/intermediate/05_api_documentation/api/post_create_user.mmt +25 -0
  40. package/dist/examples/intermediate/05_api_documentation/api/ws_notifications.mmt +18 -0
  41. package/dist/examples/intermediate/05_api_documentation/document.mmt +17 -0
  42. package/dist/examples/intermediate/05_api_documentation/markdown_api/health_check.mmt +6 -0
  43. package/dist/examples/intermediate/05_api_documentation/markdown_api/overview.md +77 -0
  44. package/dist/examples/intermediate/05_api_documentation/markdown_api/search_products.mmt +15 -0
  45. package/dist/examples/intermediate/05_api_documentation/markdown_api/submit_order.mmt +18 -0
  46. package/dist/examples/intermediate/06_imports/README.md +92 -0
  47. package/dist/examples/intermediate/06_imports/apis/echo_api.mmt +13 -0
  48. package/dist/examples/intermediate/06_imports/apis/greet_api.mmt +13 -0
  49. package/dist/examples/intermediate/06_imports/multimeter.mmt +5 -0
  50. package/dist/examples/intermediate/06_imports/test_relative.mmt +15 -0
  51. package/dist/examples/intermediate/06_imports/test_root_import.mmt +14 -0
  52. package/dist/examples/intermediate/06_imports/tests/test_api.mmt +30 -0
  53. package/dist/examples/intermediate/07_simple_suite/README.md +56 -0
  54. package/dist/examples/intermediate/07_simple_suite/api/echo_api.mmt +12 -0
  55. package/dist/examples/intermediate/07_simple_suite/api/status_api.mmt +8 -0
  56. package/dist/examples/intermediate/07_simple_suite/suite_parallel.mmt +11 -0
  57. package/dist/examples/intermediate/07_simple_suite/suite_sequential.mmt +14 -0
  58. package/dist/examples/intermediate/07_simple_suite/test/echo_test.mmt +16 -0
  59. package/dist/examples/intermediate/07_simple_suite/test/echo_test_fail.mmt +15 -0
  60. package/dist/examples/intermediate/07_simple_suite/test/status_test.mmt +11 -0
  61. package/dist/examples/intermediate/07_simple_suite/test/status_test_fail.mmt +11 -0
  62. package/dist/examples/intermediate/08_chained_api_calls/README.md +58 -0
  63. package/dist/examples/intermediate/08_chained_api_calls/api/get_profile.mmt +15 -0
  64. package/dist/examples/intermediate/08_chained_api_calls/api/login.mmt +17 -0
  65. package/dist/examples/intermediate/08_chained_api_calls/chained_test.mmt +31 -0
  66. package/dist/examples/intermediate/09_csv_data_driven_test/README.md +80 -0
  67. package/dist/examples/intermediate/09_csv_data_driven_test/echo_api.mmt +14 -0
  68. package/dist/examples/intermediate/09_csv_data_driven_test/echo_csv_test.mmt +18 -0
  69. package/dist/examples/intermediate/10_environment_presets/README.md +58 -0
  70. package/dist/examples/intermediate/10_environment_presets/api/echo_env.mmt +14 -0
  71. package/dist/examples/intermediate/10_environment_presets/multimeter.mmt +22 -0
  72. package/dist/examples/intermediate/10_environment_presets/test/preset_test.mmt +14 -0
  73. package/dist/examples/intermediate/11_control_flow/README.md +48 -0
  74. package/dist/examples/intermediate/11_control_flow/api/echo.mmt +13 -0
  75. package/dist/examples/intermediate/11_control_flow/for_loop_test.mmt +15 -0
  76. package/dist/examples/intermediate/11_control_flow/if_else_test.mmt +19 -0
  77. package/dist/examples/intermediate/11_control_flow/repeat_delay_test.mmt +24 -0
  78. package/dist/examples/intermediate/12_random_values/README.md +59 -0
  79. package/dist/examples/intermediate/12_random_values/api/random_echo.mmt +21 -0
  80. package/dist/examples/intermediate/12_random_values/random_values_test.mmt +15 -0
  81. package/dist/examples/intermediate/13_stages_and_conditions/README.md +58 -0
  82. package/dist/examples/intermediate/13_stages_and_conditions/api/get_profile.mmt +13 -0
  83. package/dist/examples/intermediate/13_stages_and_conditions/api/get_settings.mmt +13 -0
  84. package/dist/examples/intermediate/13_stages_and_conditions/api/login.mmt +15 -0
  85. package/dist/examples/intermediate/13_stages_and_conditions/stages_test.mmt +40 -0
  86. package/dist/examples/intermediate/14_javascript_helpers/README.md +59 -0
  87. package/dist/examples/intermediate/14_javascript_helpers/api/echo.mmt +13 -0
  88. package/dist/examples/intermediate/14_javascript_helpers/js_test.mmt +31 -0
  89. package/dist/examples/intermediate/15_http_files/README.md +25 -0
  90. package/dist/examples/intermediate/15_http_files/import_http_in_test.mmt +8 -0
  91. package/dist/examples/intermediate/16_bruno_files/README.md +36 -0
  92. package/dist/examples/intermediate/16_bruno_files/import_bruno_in_test.mmt +18 -0
  93. package/dist/examples/intermediate/16_bruno_files/library/README.md +8 -0
  94. package/dist/examples/intermediate/17_api_authentication/README.md +35 -0
  95. package/dist/examples/intermediate/17_api_authentication/get_with_apikey_auth.mmt +10 -0
  96. package/dist/examples/intermediate/17_api_authentication/get_with_basic_auth.mmt +10 -0
  97. package/dist/examples/intermediate/17_api_authentication/get_with_bearer_auth.mmt +9 -0
  98. package/dist/examples/intermediate/18_simple_mock_server/README.md +92 -0
  99. package/dist/examples/intermediate/18_simple_mock_server/api/create_user.mmt +15 -0
  100. package/dist/examples/intermediate/18_simple_mock_server/api/get_health.mmt +9 -0
  101. package/dist/examples/intermediate/18_simple_mock_server/api/get_user.mmt +12 -0
  102. package/dist/examples/intermediate/18_simple_mock_server/api/search.mmt +11 -0
  103. package/dist/examples/intermediate/18_simple_mock_server/server/mock_server.mmt +46 -0
  104. package/dist/examples/intermediate/18_simple_mock_server/suite.mmt +12 -0
  105. package/dist/examples/intermediate/18_simple_mock_server/test/health_test.mmt +13 -0
  106. package/dist/examples/intermediate/18_simple_mock_server/test/search_test.mmt +15 -0
  107. package/dist/examples/intermediate/18_simple_mock_server/test/user_test.mmt +27 -0
  108. package/dist/examples/intermediate/19_environment_post_echo/README.md +33 -0
  109. package/dist/examples/intermediate/19_environment_post_echo/multimeter.mmt +4 -0
  110. package/dist/examples/intermediate/19_environment_post_echo/post_echo.mmt +12 -0
  111. package/dist/examples/intermediate/20_document_parameters/README.md +25 -0
  112. package/dist/examples/intermediate/20_document_parameters/api/search_users.mmt +28 -0
  113. package/dist/examples/intermediate/20_document_parameters/document.mmt +6 -0
  114. package/dist/examples/intermediate/21_manual_timeout/README.md +22 -0
  115. package/dist/examples/intermediate/21_manual_timeout/manual_timeout.mmt +11 -0
  116. package/dist/examples/intermediate/22_omit_keyword/README.md +45 -0
  117. package/dist/examples/intermediate/22_omit_keyword/omit_keyword.mmt +34 -0
  118. package/dist/examples/intermediate/22_omit_keyword/omit_keyword_test.mmt +19 -0
  119. package/dist/examples/intermediate/23_check_operators/README.md +31 -0
  120. package/dist/examples/intermediate/23_check_operators/api/sample.mmt +27 -0
  121. package/dist/examples/intermediate/23_check_operators/operators_test.mmt +54 -0
  122. package/dist/examples/intermediate/24_test_call_cache/README.md +34 -0
  123. package/dist/examples/intermediate/24_test_call_cache/api/login_echo.mmt +19 -0
  124. package/dist/examples/intermediate/24_test_call_cache/create_session.mmt +28 -0
  125. package/dist/examples/intermediate/24_test_call_cache/use_session_cache.mmt +41 -0
  126. package/dist/examples/intermediate/25_convert_to_mmt/README.md +17 -0
  127. package/dist/examples/intermediate/25_convert_to_mmt/bruno/README.md +5 -0
  128. package/dist/examples/intermediate/25_convert_to_mmt/bruno/converted/api/create-user.mmt +11 -0
  129. package/dist/examples/intermediate/25_convert_to_mmt/bruno/converted/tests/create-user.mmt +11 -0
  130. package/dist/examples/intermediate/25_convert_to_mmt/http/README.md +5 -0
  131. package/dist/examples/intermediate/25_convert_to_mmt/http/converted/api/ping.mmt +9 -0
  132. package/dist/examples/intermediate/25_convert_to_mmt/http/converted/tests/source-http.mmt +11 -0
  133. package/dist/examples/intermediate/25_convert_to_mmt/openapi/README.md +5 -0
  134. package/dist/examples/intermediate/25_convert_to_mmt/openapi/converted/api/get-sample-json.mmt +8 -0
  135. package/dist/examples/intermediate/25_convert_to_mmt/postman/README.md +7 -0
  136. package/dist/examples/intermediate/25_convert_to_mmt/postman/converted/api/ping.mmt +23 -0
  137. package/dist/examples/intermediate/25_convert_to_mmt/postman/converted/suites/collection.mmt +7 -0
  138. package/dist/examples/intermediate/25_convert_to_mmt/postman/converted/tests/collection.mmt +17 -0
  139. package/dist/examples/intermediate/25_convert_to_mmt/wsdl/README.md +5 -0
  140. package/dist/examples/intermediate/25_convert_to_mmt/wsdl/converted/api/ping.mmt +21 -0
  141. package/dist/examples/intermediate/26_yaml_expect_typing/README.md +21 -0
  142. package/dist/examples/intermediate/26_yaml_expect_typing/typing_test.mmt +29 -0
  143. package/dist/examples/intermediate/27_ai_judge/README.md +31 -0
  144. package/dist/examples/intermediate/27_ai_judge/judge_demo.mmt +33 -0
  145. package/dist/examples/intermediate/27_ai_judge/judges/gemini.mmt +12 -0
  146. package/dist/examples/intermediate/27_ai_judge/judges/ollama.mmt +8 -0
  147. package/dist/examples/professional/01_report_generation/README.md +87 -0
  148. package/dist/examples/professional/01_report_generation/api/echo.mmt +13 -0
  149. package/dist/examples/professional/01_report_generation/suite.mmt +12 -0
  150. package/dist/examples/professional/01_report_generation/test/fail_test.mmt +11 -0
  151. package/dist/examples/professional/01_report_generation/test/pass_test.mmt +17 -0
  152. package/dist/examples/professional/02_tls_certificates/README.md +113 -0
  153. package/dist/examples/professional/02_tls_certificates/api/secure_echo.mmt +13 -0
  154. package/dist/examples/professional/02_tls_certificates/env.mmt +17 -0
  155. package/dist/examples/professional/02_tls_certificates/tls_test.mmt +12 -0
  156. package/dist/examples/professional/03_load_test/README.md +39 -0
  157. package/dist/examples/professional/03_load_test/echo_api.mmt +12 -0
  158. package/dist/examples/professional/03_load_test/echo_test.mmt +14 -0
  159. package/dist/examples/professional/03_load_test/loadtest.mmt +15 -0
  160. package/dist/examples/professional/04_convert_to_mmt/README.md +30 -0
  161. package/dist/examples/professional/04_convert_to_mmt/bruno/README.md +8 -0
  162. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/basic-auth-check.mmt +9 -0
  163. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/bearer-auth-check.mmt +12 -0
  164. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/cache-headers.mmt +9 -0
  165. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/delayed-response.mmt +9 -0
  166. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/echo-anything-alias.mmt +11 -0
  167. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/echo-delete.mmt +9 -0
  168. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/echo-get-with-query.mmt +10 -0
  169. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/echo-post-body.mmt +13 -0
  170. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/echo-put-body.mmt +14 -0
  171. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/get-sample-html.mmt +9 -0
  172. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/get-sample-json.mmt +9 -0
  173. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/get-sample-xml.mmt +9 -0
  174. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/method-match-get.mmt +9 -0
  175. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/random-bytes.mmt +9 -0
  176. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/redirect-twice.mmt +9 -0
  177. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/return-client-ip.mmt +9 -0
  178. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/return-cookies.mmt +9 -0
  179. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/return-request-headers.mmt +10 -0
  180. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/return-status-200.mmt +9 -0
  181. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/return-status-404.mmt +9 -0
  182. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/service-help.mmt +9 -0
  183. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/set-cookie.mmt +9 -0
  184. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/basic-auth-check.mmt +11 -0
  185. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/bearer-auth-check.mmt +11 -0
  186. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/cache-headers.mmt +11 -0
  187. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/delayed-response.mmt +11 -0
  188. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/echo-anything-alias.mmt +11 -0
  189. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/echo-delete.mmt +11 -0
  190. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/echo-get-with-query.mmt +11 -0
  191. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/echo-post-body.mmt +11 -0
  192. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/echo-put-body.mmt +11 -0
  193. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/get-sample-html.mmt +11 -0
  194. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/get-sample-json.mmt +11 -0
  195. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/get-sample-xml.mmt +11 -0
  196. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/method-match-get.mmt +11 -0
  197. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/random-bytes.mmt +11 -0
  198. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/redirect-twice.mmt +11 -0
  199. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/return-client-ip.mmt +11 -0
  200. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/return-cookies.mmt +11 -0
  201. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/return-request-headers.mmt +11 -0
  202. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/return-status-200.mmt +11 -0
  203. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/return-status-404.mmt +11 -0
  204. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/service-help.mmt +11 -0
  205. package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/set-cookie.mmt +11 -0
  206. package/dist/examples/professional/04_convert_to_mmt/http/README.md +7 -0
  207. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/basic-auth-check.mmt +10 -0
  208. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/bearer-auth-check.mmt +10 -0
  209. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/cache-headers.mmt +9 -0
  210. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/delayed-response.mmt +9 -0
  211. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/echo-anything-alias.mmt +11 -0
  212. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/echo-delete.mmt +9 -0
  213. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/echo-get-with-query.mmt +10 -0
  214. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/echo-post-body.mmt +13 -0
  215. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/echo-put-body.mmt +14 -0
  216. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/get-sample-html.mmt +9 -0
  217. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/get-sample-json.mmt +9 -0
  218. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/get-sample-xml.mmt +9 -0
  219. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/method-match-get.mmt +9 -0
  220. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/random-bytes.mmt +9 -0
  221. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/redirect-twice.mmt +9 -0
  222. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/return-client-ip.mmt +9 -0
  223. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/return-cookies.mmt +9 -0
  224. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/return-request-headers.mmt +10 -0
  225. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/return-status-200.mmt +9 -0
  226. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/return-status-404.mmt +9 -0
  227. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/service-help.mmt +9 -0
  228. package/dist/examples/professional/04_convert_to_mmt/http/converted/api/set-cookie.mmt +9 -0
  229. package/dist/examples/professional/04_convert_to_mmt/http/converted/tests/source-http.mmt +95 -0
  230. package/dist/examples/professional/04_convert_to_mmt/openapi/README.md +8 -0
  231. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/basic-auth-check.mmt +11 -0
  232. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/bearer-auth-check.mmt +11 -0
  233. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/cache-headers.mmt +7 -0
  234. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/delayed-response.mmt +7 -0
  235. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/echo-anything-alias.mmt +13 -0
  236. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/echo-delete.mmt +7 -0
  237. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/echo-get-with-query.mmt +11 -0
  238. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/echo-post-body.mmt +36 -0
  239. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/echo-put-body.mmt +25 -0
  240. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/get-sample-html.mmt +7 -0
  241. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/get-sample-json.mmt +7 -0
  242. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/get-sample-xml.mmt +7 -0
  243. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/method-match.mmt +7 -0
  244. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/random-bytes.mmt +7 -0
  245. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/redirect-n-times.mmt +7 -0
  246. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/return-client-ip.mmt +7 -0
  247. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/return-cookies.mmt +7 -0
  248. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/return-request-headers.mmt +7 -0
  249. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/return-status-code.mmt +7 -0
  250. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/service-help.mmt +7 -0
  251. package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/set-cookie.mmt +9 -0
  252. package/dist/examples/professional/04_convert_to_mmt/postman/README.md +8 -0
  253. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/auth/basic-auth-check.mmt +11 -0
  254. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/auth/bearer-auth-check.mmt +10 -0
  255. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/echo/echo-anything-alias.mmt +11 -0
  256. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/echo/echo-delete.mmt +7 -0
  257. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/echo/echo-get-with-query.mmt +8 -0
  258. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/echo/echo-post-body.mmt +13 -0
  259. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/echo/echo-put-body.mmt +14 -0
  260. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/inspect/return-client-ip.mmt +7 -0
  261. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/inspect/return-cookies.mmt +7 -0
  262. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/inspect/return-request-headers.mmt +8 -0
  263. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/inspect/set-cookie.mmt +7 -0
  264. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/samples/get-sample-html.mmt +7 -0
  265. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/samples/get-sample-json.mmt +28 -0
  266. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/samples/get-sample-xml.mmt +7 -0
  267. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/samples/random-bytes.mmt +7 -0
  268. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/samples/service-help.mmt +7 -0
  269. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/status/cache-headers.mmt +7 -0
  270. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/status/delayed-response.mmt +7 -0
  271. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/status/method-match-get.mmt +7 -0
  272. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/status/redirect-twice.mmt +7 -0
  273. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/status/return-status-200.mmt +7 -0
  274. package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/status/return-status-404.mmt +7 -0
  275. package/dist/examples/professional/04_convert_to_mmt/postman/converted/multimeter.mmt +11 -0
  276. package/dist/examples/professional/04_convert_to_mmt/postman/converted/suites/auth.mmt +7 -0
  277. package/dist/examples/professional/04_convert_to_mmt/postman/converted/suites/collection.mmt +15 -0
  278. package/dist/examples/professional/04_convert_to_mmt/postman/converted/suites/echo.mmt +7 -0
  279. package/dist/examples/professional/04_convert_to_mmt/postman/converted/suites/inspect.mmt +7 -0
  280. package/dist/examples/professional/04_convert_to_mmt/postman/converted/suites/samples.mmt +7 -0
  281. package/dist/examples/professional/04_convert_to_mmt/postman/converted/suites/status.mmt +7 -0
  282. package/dist/examples/professional/04_convert_to_mmt/postman/converted/tests/auth.mmt +15 -0
  283. package/dist/examples/professional/04_convert_to_mmt/postman/converted/tests/echo.mmt +27 -0
  284. package/dist/examples/professional/04_convert_to_mmt/postman/converted/tests/inspect.mmt +23 -0
  285. package/dist/examples/professional/04_convert_to_mmt/postman/converted/tests/samples.mmt +29 -0
  286. package/dist/examples/professional/04_convert_to_mmt/postman/converted/tests/status.mmt +31 -0
  287. package/dist/examples/professional/04_convert_to_mmt/wsdl/README.md +8 -0
  288. package/dist/examples/professional/04_convert_to_mmt/wsdl/converted/api/echomessage.mmt +23 -0
  289. package/dist/examples/professional/04_convert_to_mmt/wsdl/converted/api/getsamplexml.mmt +21 -0
  290. package/dist/examples/professional/04_convert_to_mmt/wsdl/converted/api/probestatus.mmt +21 -0
  291. package/dist/examples/professional/05_tls_mock_server/README.md +19 -0
  292. package/dist/examples/professional/05_tls_mock_server/api/secure_health.mmt +11 -0
  293. package/dist/examples/professional/05_tls_mock_server/multimeter.mmt +3 -0
  294. package/dist/examples/professional/05_tls_mock_server/server/mock_server.mmt +23 -0
  295. package/dist/examples/professional/05_tls_mock_server/test/secure_health_test.mmt +15 -0
  296. package/dist/examples/professional/06_mtls_mock_server/README.md +23 -0
  297. package/dist/examples/professional/06_mtls_mock_server/api/secure_health.mmt +11 -0
  298. package/dist/examples/professional/06_mtls_mock_server/multimeter.mmt +12 -0
  299. package/dist/examples/professional/06_mtls_mock_server/server/mock_server.mmt +24 -0
  300. package/dist/examples/professional/06_mtls_mock_server/test/secure_health_test.mmt +15 -0
  301. package/dist/examples/professional/07_mock_server_timeout/README.md +26 -0
  302. package/dist/examples/professional/07_mock_server_timeout/api/slow_request.mmt +10 -0
  303. package/dist/examples/professional/07_mock_server_timeout/server/mock_server.mmt +19 -0
  304. package/dist/examples/professional/07_mock_server_timeout/suite.mmt +7 -0
  305. package/dist/examples/professional/07_mock_server_timeout/test/slow_timeout_test.mmt +15 -0
  306. package/dist/examples/professional/08_external_mtls_badssl/README.md +52 -0
  307. package/dist/examples/professional/08_external_mtls_badssl/api/badssl_client.mmt +6 -0
  308. package/dist/examples/professional/08_external_mtls_badssl/badssl_mtls_test.mmt +10 -0
  309. package/dist/examples/professional/08_external_mtls_badssl/multimeter.mmt +13 -0
  310. package/dist/examples/professional/09_ci_pipelines/README.md +92 -0
  311. package/dist/examples/professional/09_ci_pipelines/smoke_get.mmt +9 -0
  312. package/dist/examples/professional/09_ci_pipelines/smoke_post.mmt +12 -0
  313. package/dist/examples/professional/09_ci_pipelines/suite.mmt +9 -0
  314. package/dist/examples/professional/10_vault_http_setenv/README.md +60 -0
  315. package/dist/examples/professional/10_vault_http_setenv/api/bearer_with_env_token.mmt +16 -0
  316. package/dist/examples/professional/10_vault_http_setenv/api/vault_kv_read.mmt +22 -0
  317. package/dist/examples/professional/10_vault_http_setenv/env.mmt +21 -0
  318. package/dist/examples/professional/10_vault_http_setenv/server/vault_kv_mock.mmt +45 -0
  319. package/dist/examples/professional/10_vault_http_setenv/vault_to_api_test.mmt +22 -0
  320. package/dist/guides/agent-workflow.md +75 -0
  321. package/dist/guides/general.md +64 -0
  322. package/dist/guides/generate-api.md +221 -0
  323. package/dist/guides/generate-doc.md +103 -0
  324. package/dist/guides/generate-env.md +147 -0
  325. package/dist/guides/generate-loadtest.md +55 -0
  326. package/dist/guides/generate-suite.md +167 -0
  327. package/dist/guides/generate-test-skill.md +60 -0
  328. package/dist/guides/generate-test.md +335 -0
  329. package/dist/guides/generate.md +60 -0
  330. package/dist/guides/golden-smoke.md +52 -0
  331. package/dist/guides/min/api.md +29 -0
  332. package/dist/guides/min/constraints.md +9 -0
  333. package/dist/guides/min/doc.md +17 -0
  334. package/dist/guides/min/env.md +26 -0
  335. package/dist/guides/min/loadtest.md +17 -0
  336. package/dist/guides/min/overview.md +25 -0
  337. package/dist/guides/min/suite.md +18 -0
  338. package/dist/guides/min/test.md +42 -0
  339. package/dist/guides/min/workflow.md +16 -0
  340. package/dist/guides/offline-agent.md +46 -0
  341. package/dist/server.cjs +27500 -0
  342. package/dist/server.js +27500 -0
  343. package/package.json +58 -0
@@ -0,0 +1,14 @@
1
+ type: test
2
+ title: Import test with project root path
3
+ description: |-
4
+ Imports a test using the +/ project root path and calls it.
5
+ The +/ prefix resolves from the directory containing multimeter.mmt.
6
+ import:
7
+ api_test: +/tests/test_api.mmt
8
+ steps:
9
+ - call: api_test
10
+ id: result
11
+ title: Run API test (+/ project root import)
12
+ inputs:
13
+ message: from project root import
14
+ name: root call
@@ -0,0 +1,30 @@
1
+ type: test
2
+ title: Test calling imported APIs
3
+ description: |-
4
+ Imports two APIs using relative paths and calls each one.
5
+ Shows same-directory and subfolder relative imports.
6
+ import:
7
+ echo: ../apis/echo_api.mmt
8
+ greet: +/apis/greet_api.mmt
9
+ inputs:
10
+ message: hello imports
11
+ name: multimeter
12
+ steps:
13
+ - call: echo
14
+ id: echoResult
15
+ title: Call echo API (relative import from parent dir)
16
+ inputs:
17
+ message: i:message
18
+ expect:
19
+ status_code: 200
20
+ echoed_message: <<i:message>>
21
+ report: all
22
+ - call: greet
23
+ id: greetResult
24
+ title: Call greet API (relative import from parent dir)
25
+ inputs:
26
+ name: i:name
27
+ expect:
28
+ status_code: == 200
29
+ greeted_name: == <<i:name>>
30
+ report: all
@@ -0,0 +1,56 @@
1
+ # Simple Suite
2
+
3
+ A minimal example of `type: suite` files that run multiple tests together, demonstrating both **parallel** and **sequential** execution modes.
4
+
5
+ ## Structure
6
+
7
+ ```
8
+ 07_simple_suite/
9
+ ├── api/
10
+ │ ├── echo_api.mmt # API that echoes a posted message
11
+ │ └── status_api.mmt # API that returns server status
12
+ ├── test/
13
+ │ ├── echo_test.mmt # Test that calls the echo API and checks the response
14
+ │ ├── echo_test_fail.mmt # Test that calls the echo API and expects a failure
15
+ │ ├── status_test.mmt # Test that calls the status API and checks the status code
16
+ │ └── status_test_fail.mmt # Test that calls the status API and expects a failure
17
+ ├── suite_parallel.mmt # Suite that runs all tests in parallel
18
+ ├── suite_sequential.mmt # Suite that runs all tests one after another
19
+ └── README.md
20
+ ```
21
+
22
+ ## Files
23
+
24
+ | File | Description |
25
+ |---|---|
26
+ | `api/echo_api.mmt` | Posts a message and extracts the echoed value |
27
+ | `api/status_api.mmt` | Sends a GET request and extracts the status code |
28
+ | `test/echo_test.mmt` | Calls the echo API with an input and verifies it is echoed back |
29
+ | `test/echo_test_fail.mmt` | Calls the echo API and expects the assertion to fail |
30
+ | `test/status_test.mmt` | Calls the status API and verifies a 200 response |
31
+ | `test/status_test_fail.mmt` | Calls the status API and expects the assertion to fail |
32
+ | `suite_parallel.mmt` | Suite that runs all four tests in parallel (default behavior) |
33
+ | `suite_sequential.mmt` | Suite that runs all four tests sequentially using `then` separators |
34
+
35
+ ## Parallel vs Sequential
36
+
37
+ - **Parallel** (`suite_parallel.mmt`): all items are listed directly under `items` and execute at the same time.
38
+ - **Sequential** (`suite_sequential.mmt`): tests are separated by `- then` entries, so each test waits for the previous one to finish before starting.
39
+
40
+ ## How to use
41
+
42
+ ### In VS Code
43
+
44
+ 1. Open `suite_parallel.mmt` or `suite_sequential.mmt`.
45
+ 2. Click **Run** to execute the suite.
46
+ 3. The panel shows the result of each test.
47
+
48
+ ### With the CLI
49
+
50
+ ```sh
51
+ # Run tests in parallel
52
+ npx testlight run examples/intermediate/07_simple_suite/suite_parallel.mmt
53
+
54
+ # Run tests sequentially
55
+ npx testlight run examples/intermediate/07_simple_suite/suite_sequential.mmt
56
+ ```
@@ -0,0 +1,12 @@
1
+ type: api
2
+ title: Echo API
3
+ description: Posts a message and echoes it back
4
+ inputs:
5
+ message: hello world
6
+ outputs:
7
+ echoed_message: body.body.message
8
+ url: https://test.mmt.dev/echo
9
+ method: post
10
+ format: json
11
+ body:
12
+ message: i:message
@@ -0,0 +1,8 @@
1
+ type: api
2
+ title: Status API
3
+ description: Returns server status information
4
+ outputs:
5
+ status_code: status
6
+ server_name: body.server
7
+ url: https://test.mmt.dev/echo
8
+ method: get
@@ -0,0 +1,11 @@
1
+ type: suite
2
+ title: Simple Suite
3
+ description: Runs the echo and status tests together
4
+ tags:
5
+ - example
6
+ - smoke
7
+ items:
8
+ - test/echo_test.mmt
9
+ - test/status_test.mmt
10
+ - test/echo_test_fail.mmt
11
+ - test/status_test_fail.mmt
@@ -0,0 +1,14 @@
1
+ type: suite
2
+ title: Simple Suite
3
+ description: Runs the echo and status tests together
4
+ tags:
5
+ - example
6
+ - smoke
7
+ items:
8
+ - test/echo_test.mmt
9
+ - then
10
+ - test/status_test.mmt
11
+ - then
12
+ - test/echo_test_fail.mmt
13
+ - then
14
+ - test/status_test_fail.mmt
@@ -0,0 +1,16 @@
1
+ type: test
2
+ title: Test echo API
3
+ description: Calls the echo API and verifies the echoed message
4
+ import:
5
+ echo: ../api/echo_api.mmt
6
+ inputs:
7
+ message: hello from suite
8
+ steps:
9
+ - call: echo
10
+ id: result
11
+ inputs:
12
+ message: i:message
13
+ expect:
14
+ echoed_message: <<i:message>>
15
+ report: all
16
+ - delay: 2s
@@ -0,0 +1,15 @@
1
+ type: test
2
+ title: Test echo API (fail case)
3
+ description: Calls the echo API and expects a wrong message — should fail
4
+ import:
5
+ echo: ../api/echo_api.mmt
6
+ inputs:
7
+ message: hello from suite
8
+ steps:
9
+ - call: echo
10
+ id: result
11
+ inputs:
12
+ message: i:message
13
+ expect:
14
+ echoed_message: this will not match
15
+ report: all
@@ -0,0 +1,11 @@
1
+ type: test
2
+ title: Test status API
3
+ description: Calls the status API and verifies a successful response
4
+ import:
5
+ status: ../api/status_api.mmt
6
+ steps:
7
+ - call: status
8
+ id: result
9
+ expect:
10
+ status_code: 200
11
+ report: all
@@ -0,0 +1,11 @@
1
+ type: test
2
+ title: Test status API (fail case)
3
+ description: Calls the status API and expects a wrong status code — should fail
4
+ import:
5
+ status: ../api/status_api.mmt
6
+ steps:
7
+ - call: status
8
+ id: result
9
+ expect:
10
+ status_code: 404
11
+ report: all
@@ -0,0 +1,58 @@
1
+ # Chained API Calls
2
+
3
+ Shows how to **chain API calls** — the output of one call feeds into the next. Demonstrates test `outputs`, `set`, `setenv`, and inline `expect`.
4
+
5
+ ## Structure
6
+
7
+ ```
8
+ 08_chained_api_calls/
9
+ ├── api/
10
+ │ ├── login.mmt # POST login, outputs token + user_id
11
+ │ └── get_profile.mmt # POST profile lookup using token
12
+ ├── chained_test.mmt # Test that chains login → profile
13
+ └── README.md
14
+ ```
15
+
16
+ ## Files
17
+
18
+ | File | Description |
19
+ |---|---|
20
+ | `api/login.mmt` | Sends credentials, extracts `token` and `user_id` from the response |
21
+ | `api/get_profile.mmt` | Uses a token and user_id to fetch a profile |
22
+ | `chained_test.mmt` | Calls login, saves `session_token` and `user_id` into test outputs, promotes `auth_token` with `setenv`, then calls get_profile |
23
+
24
+ ## Key concepts
25
+
26
+ - **Step output chaining** — `${auth.token}` and `${auth.user_id}` read values from the `login` call result.
27
+ - **Test outputs** — the test declares top-level `outputs` (`session_token`, `user_id`) and fills them with `set` keys `o:session_token` / `o:user_id` so later steps can read `o:…` (same as `${outputs.…}`).
28
+ - **`setenv`** — promotes `${auth.token}` into the environment as `auth_token` so downstream APIs or tests can use `e:auth_token` or `<<e:auth_token>>`.
29
+ - **Inline `expect`** — validates outputs directly on a `call` step without a separate `assert`/`check`. In this example it checks that `token` and `name` are not null.
30
+
31
+ ## Flow summary
32
+
33
+ 1. `login` is called with `username` and `password` inputs.
34
+ 2. The call verifies `token: != null` with inline `expect`.
35
+ 3. `set` writes `o:session_token` / `o:user_id` from `${auth.token}` / `${auth.user_id}`.
36
+ 4. `setenv` promotes the token as `auth_token`.
37
+ 5. `getProfile` is called with `o:session_token` and `o:user_id`.
38
+ 6. The second call verifies `name: != null` with inline `expect`.
39
+
40
+ ## How to use
41
+
42
+ ### In VS Code
43
+
44
+ 1. Open `chained_test.mmt` and click **Run**.
45
+ 2. The Log panel shows both API calls, the inline expect results, and the populated test outputs.
46
+
47
+ ### With the CLI
48
+
49
+ ```sh
50
+ npx testlight run examples/intermediate/08_chained_api_calls/chained_test.mmt
51
+ ```
52
+
53
+ Override credentials:
54
+
55
+ ```sh
56
+ npx testlight run examples/intermediate/08_chained_api_calls/chained_test.mmt \
57
+ -e username=bob@example.com -e password=hunter2
58
+ ```
@@ -0,0 +1,15 @@
1
+ type: api
2
+ title: Get User Profile
3
+ description: Fetches a user profile using a session token
4
+ inputs:
5
+ token: placeholder
6
+ user_id: "1"
7
+ outputs:
8
+ name: body.body.user_id
9
+ email: body.body.token
10
+ url: https://test.mmt.dev/echo
11
+ method: post
12
+ format: json
13
+ body:
14
+ token: i:token
15
+ user_id: i:user_id
@@ -0,0 +1,17 @@
1
+ type: api
2
+ title: Login
3
+ description: Authenticates a user and returns a session token
4
+ inputs:
5
+ username: alice@example.com
6
+ password: secret123
7
+ outputs:
8
+ token: body.body.token
9
+ user_id: body.body.user_id
10
+ url: https://test.mmt.dev/echo
11
+ method: post
12
+ format: json
13
+ body:
14
+ username: i:username
15
+ password: i:password
16
+ token: r:uuid
17
+ user_id: 1
@@ -0,0 +1,31 @@
1
+ type: test
2
+ title: Chained API Calls
3
+ description: Login, capture the token, then fetch the user profile using the token
4
+ import:
5
+ login: ./api/login.mmt
6
+ getProfile: ./api/get_profile.mmt
7
+ inputs:
8
+ username: alice@example.com
9
+ password: secret123
10
+ outputs:
11
+ session_token: ""
12
+ user_id: ""
13
+ steps:
14
+ - call: login
15
+ id: auth
16
+ inputs:
17
+ username: i:username
18
+ password: i:password
19
+ expect:
20
+ token: != null
21
+ - set:
22
+ o:session_token: ${auth.token}
23
+ o:user_id: ${auth.user_id}
24
+ - setenv:
25
+ auth_token: ${auth.token}
26
+ - call: getProfile
27
+ inputs:
28
+ token: o:session_token
29
+ user_id: o:user_id
30
+ expect:
31
+ name: != null
@@ -0,0 +1,80 @@
1
+ # CSV Data-Driven Test
2
+
3
+ Run the same API call for every row in a CSV file and check the results. This is useful for parameterized testing — define your test data in a spreadsheet-friendly format and let the test loop through it.
4
+
5
+ ## Files
6
+
7
+ | File | Description |
8
+ |---|---|
9
+ | `echo_api.mmt` | API definition — POSTs a message to the echo endpoint and extracts the response |
10
+ | `messages.csv` | CSV data file with `message` and `expected_method` columns |
11
+ | `echo_csv_test.mmt` | Test — imports the CSV, loops over each row, calls the API, and checks the outputs |
12
+
13
+ ## How to use
14
+
15
+ ### In VS Code
16
+
17
+ 1. Open `echo_csv_test.mmt`.
18
+ 2. Click **Run** to execute the test.
19
+ 3. The Log panel shows a check result for every row in the CSV.
20
+
21
+ ### With the CLI
22
+
23
+ ```sh
24
+ npx testlight run examples/intermediate/09_csv_data_driven_test/echo_csv_test.mmt
25
+ ```
26
+
27
+ ## How it works
28
+
29
+ ### 1. Define your test data in a CSV
30
+
31
+ ```csv
32
+ message,expected_method
33
+ hello world,POST
34
+ goodbye,POST
35
+ test 123,POST
36
+ ```
37
+
38
+ - The first row is the header — each column becomes a field name on the row object.
39
+ - Unquoted numbers are auto-coerced (`"42"` → `42`); `true`/`false` become booleans.
40
+ - Quoted values stay as strings (e.g. `"00123"` stays `"00123"`).
41
+
42
+ ### 2. Import the CSV and bind it with `data`
43
+
44
+ ```yaml
45
+ import:
46
+ messages: messages.csv
47
+ steps:
48
+ - for: message of messages
49
+ ```
50
+
51
+ The `data` step binds the imported CSV alias into scope so it can be used in loops and expressions.
52
+
53
+ ### 3. Loop with `for`
54
+
55
+ ```yaml
56
+ - for: const row of messages
57
+ steps:
58
+ - call: echo
59
+ inputs:
60
+ message: ${row.message}
61
+ check:
62
+ - echoed_message == ${row.message}
63
+ ```
64
+
65
+ The `for` expression is standard JavaScript — `const row of messages` iterates over each CSV row. Inside the loop, wrap runtime variables in `${...}` — both in inputs (`message: ${row.column_name}`) and in checks (`output == ${row.column_name}`). This is because values are evaluated as JavaScript template literals, and `${...}` triggers interpolation.
66
+
67
+ ## Key concepts
68
+
69
+ - **`import`** — imports both `.mmt` files and `.csv` files by alias.
70
+ - **`data`** — binds an imported CSV into the runtime scope for iteration.
71
+ - **`for`** — iterates using any valid JS expression. `const row of messages` loops over CSV rows.
72
+ - **`check`** — inline checks that compare API outputs against values from the current CSV row.
73
+
74
+ ## Next steps
75
+
76
+ - See [Data-driven tests](../../../docs/features/data-driven-tests.md) for the full CSV data-driven guide.
77
+ - See [Simple Test](../../basic/02_simple_test/) for a basic test without CSV.
78
+ - See [API Inputs & Outputs](../01_api_inputs_outputs/) for more input/output patterns.
79
+ - See [Test docs — for/repeat](../../../docs/files/test/steps/control-flow.md#for-repeat) for the full `for`/`repeat` reference.
80
+ - See [Test docs — data](../../../docs/files/test/steps/variables.md#data) for more on the `data` step.
@@ -0,0 +1,14 @@
1
+ type: api
2
+ title: Echo API
3
+ description: Posts a message and echoes it back
4
+ inputs:
5
+ message: hello world
6
+ outputs:
7
+ echoed_message: body.body.message
8
+ request_method: body.method
9
+ status: status
10
+ url: https://test.mmt.dev/echo
11
+ method: post
12
+ format: json
13
+ body:
14
+ message: i:message
@@ -0,0 +1,18 @@
1
+ type: test
2
+ title: Data driven echo test
3
+ description: Loops over rows from a CSV file and calls the echo API for each message
4
+ import:
5
+ echo: echo_api.mmt
6
+ messages: messages.csv
7
+ steps:
8
+ - for: row of messages
9
+ steps:
10
+ - call: echo
11
+ id: result
12
+ title: ${row.message}
13
+ inputs:
14
+ message: ${row.message}
15
+ expect:
16
+ status: 200
17
+ echoed_message: ${row.message}
18
+ request_method: ${row.expected_method}
@@ -0,0 +1,58 @@
1
+ # Environment Presets
2
+
3
+ Shows how to use **environment files** and **presets** to manage configuration across environments.
4
+
5
+ ## Structure
6
+
7
+ ```
8
+ 10_environment_presets/
9
+ ├── multimeter.mmt # Project root marker + env variables + presets
10
+ ├── api/
11
+ │ └── echo_env.mmt # API using <<e:api_url>> and e:mode tokens
12
+ ├── test/
13
+ │ └── preset_test.mmt # Test using the selected preset
14
+ └── README.md
15
+ ```
16
+
17
+ ## Files
18
+
19
+ | File | Description |
20
+ |---|---|
21
+ | `multimeter.mmt` | Defines `api_url`, `mode`, and `timeout` variables with named choices, plus `runner.dev` and `runner.staging` presets |
22
+ | `api/echo_env.mmt` | Uses `<<e:api_url>>` in the URL and `e:mode` in the body |
23
+ | `test/preset_test.mmt` | Imports the API and runs it with the selected preset |
24
+
25
+ ## Key concepts
26
+
27
+ - **`type: env`** — defines variables with named choices (key-value map) or allowed values (array).
28
+ - **Presets** — named groups that select specific variable choices. `runner.dev` picks `api_url: local` and `mode: dev`.
29
+ - **`<<e:var>>`** — inline string substitution (always a string).
30
+ - **`e:var`** — entire-value substitution (preserves type: number, boolean, string).
31
+
32
+ ## How to use
33
+
34
+ ### In VS Code
35
+
36
+ 1. Open the folder in VS Code. The `multimeter.mmt` file is auto-loaded as the workspace environment.
37
+ 2. Use the **Environment** panel to pick a preset (e.g., `runner.dev`).
38
+ 3. Open `test/preset_test.mmt` and click **Run**.
39
+
40
+ ### With the CLI
41
+
42
+ ```sh
43
+ # Use the dev preset
44
+ npx testlight run examples/intermediate/10_environment_presets/test/preset_test.mmt \
45
+ --env-file examples/intermediate/10_environment_presets/multimeter.mmt \
46
+ --preset runner.dev
47
+
48
+ # Use the staging preset
49
+ npx testlight run examples/intermediate/10_environment_presets/test/preset_test.mmt \
50
+ --env-file examples/intermediate/10_environment_presets/multimeter.mmt \
51
+ --preset runner.staging
52
+
53
+ # Override a variable explicitly
54
+ npx testlight run examples/intermediate/10_environment_presets/test/preset_test.mmt \
55
+ --env-file examples/intermediate/10_environment_presets/multimeter.mmt \
56
+ --preset runner.dev \
57
+ -e mode=release
58
+ ```
@@ -0,0 +1,14 @@
1
+ type: api
2
+ title: Echo with Environment
3
+ description: Calls the echo API using environment variables for the base URL
4
+ inputs:
5
+ message: hello from env
6
+ outputs:
7
+ echoed_message: body.body.message
8
+ echoed_mode: body.body.mode
9
+ url: <<e:api_url>>/echo
10
+ method: post
11
+ format: json
12
+ body:
13
+ message: i:message
14
+ mode: e:mode
@@ -0,0 +1,22 @@
1
+ type: env
2
+ variables:
3
+ api_url:
4
+ local: "https://test.mmt.dev"
5
+ staging: "https://test.mmt.dev"
6
+ mode:
7
+ dev: debug
8
+ prod: release
9
+ timeout:
10
+ - 5000
11
+ - 10000
12
+ - 30000
13
+ presets:
14
+ runner:
15
+ dev:
16
+ api_url: local
17
+ mode: dev
18
+ timeout: 5000
19
+ staging:
20
+ api_url: staging
21
+ mode: prod
22
+ timeout: 10000
@@ -0,0 +1,14 @@
1
+ type: test
2
+ title: Environment Preset Test
3
+ description: Tests that environment variables from presets are applied correctly
4
+ import:
5
+ echoApi: ../api/echo_env.mmt
6
+ inputs:
7
+ message: testing presets
8
+ steps:
9
+ - call: echoApi
10
+ id: result
11
+ inputs:
12
+ message: i:message
13
+ expect:
14
+ echoed_message: <<i:message>>
@@ -0,0 +1,48 @@
1
+ # Control Flow
2
+
3
+ Demonstrates **if/else** branching, **repeat** (count and time-based), **delay**, and **for** loops in test flows.
4
+
5
+ ## Structure
6
+
7
+ ```
8
+ 11_control_flow/
9
+ ├── api/
10
+ │ └── echo.mmt # Simple echo API
11
+ ├── if_else_test.mmt # if/else conditional branching
12
+ ├── repeat_delay_test.mmt # repeat (count + time) and delay
13
+ ├── for_loop_test.mmt # for loop with index
14
+ └── README.md
15
+ ```
16
+
17
+ ## Files
18
+
19
+ | File | Description |
20
+ |---|---|
21
+ | `api/echo.mmt` | Echo API used by all tests |
22
+ | `if_else_test.mmt` | Calls the API, branches on status code with `if`/`else` |
23
+ | `repeat_delay_test.mmt` | Repeats a call 3 times, then repeats for 3 seconds, with `delay` pauses |
24
+ | `for_loop_test.mmt` | Loops 3 times with a counter using `for: let i = 0; i < 3; i++` |
25
+
26
+ ## Key concepts
27
+
28
+ - **`if` / `else`** — run nested steps conditionally. Uses the same expression syntax as `assert`/`check`.
29
+ - **`repeat: N`** — run nested steps N times (count-based).
30
+ - **`repeat: 3s`** — run nested steps for a duration. Supported units: `ns`, `ms`, `s`, `m`, `h`; combined values like `1h5m` and `5m3s` are also valid. Use `inf` for indefinite.
31
+ - **`delay: 500`** — pause in milliseconds. Also supports unit/combo values like `- delay: 2s`, `- delay: 1h5m`, or `- delay: 5m3s`.
32
+ - **`for`** — JavaScript-style loop header. Supports `for-of`, `for-in`, and classic `for` syntax.
33
+ - `${variable}` — template literals resolve variables inside strings.
34
+
35
+ ## How to use
36
+
37
+ ### In VS Code
38
+
39
+ 1. Open any test file and click **Run**.
40
+ 2. Watch the Log panel — `print` statements show progress through branches, loops, and repeats.
41
+
42
+ ### With the CLI
43
+
44
+ ```sh
45
+ npx testlight run examples/intermediate/11_control_flow/if_else_test.mmt
46
+ npx testlight run examples/intermediate/11_control_flow/repeat_delay_test.mmt
47
+ npx testlight run examples/intermediate/11_control_flow/for_loop_test.mmt
48
+ ```
@@ -0,0 +1,13 @@
1
+ type: api
2
+ title: Echo API
3
+ description: Simple echo API for control flow examples
4
+ inputs:
5
+ message: hello
6
+ outputs:
7
+ status_code: status
8
+ echoed: body.body.message
9
+ url: https://test.mmt.dev/echo
10
+ method: post
11
+ format: json
12
+ body:
13
+ message: i:message
@@ -0,0 +1,15 @@
1
+ type: test
2
+ title: Control Flow — for loop
3
+ description: Demonstrates for loops with index iteration and variable scoping
4
+ import:
5
+ echo: ./api/echo.mmt
6
+ steps:
7
+ - print: Iterating with a counter...
8
+ - for: let i = 0; i < 3; i++
9
+ steps:
10
+ - call: echo
11
+ id: iter
12
+ inputs:
13
+ message: iteration ${i}
14
+ - check: ${iter.status_code} == 200
15
+ - print: Loop completed
@@ -0,0 +1,19 @@
1
+ type: test
2
+ title: Control Flow — if/else
3
+ description: Demonstrates conditional branching with if/else
4
+ import:
5
+ echo: ./api/echo.mmt
6
+ inputs:
7
+ message: hello
8
+ steps:
9
+ - call: echo
10
+ id: result
11
+ inputs:
12
+ message: i:message
13
+ - if: ${result.status_code} == 200
14
+ steps:
15
+ - print: "Success — echoed: ${result.echoed}"
16
+ - check: ${result.echoed} == <<i:message>>
17
+ else:
18
+ - print: "Echo failed with status ${result.status_code}"
19
+ - assert: ${result.status_code} == 200