mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
js-api: Add hooks to run tests and render docs of JS API examples.
This commit adds python code to call javascript_examples.js in its two supported modes. tools/test-api asserts that the example output is as expected, whereas the API markdown extension is used to render these examples in the docs.
This commit is contained in:
committed by
Tim Abbott
parent
642d1a20d0
commit
6dd4030e67
@@ -31,6 +31,7 @@ with test_server_running(force=options.force, external_host='zulipdev.com:9981')
|
||||
# Zerver imports should happen after `django.setup()` is run
|
||||
# by the test_server_running decorator.
|
||||
from zerver.openapi.python_examples import test_the_api, test_invalid_api_key
|
||||
from zerver.openapi.javascript_examples import test_js_bindings
|
||||
from zerver.openapi.test_curl_examples import test_generated_curl_examples_for_success
|
||||
from zerver.lib.actions import do_create_user
|
||||
from zerver.lib.test_helpers import reset_emails_in_zulip_realm
|
||||
@@ -77,6 +78,7 @@ with test_server_running(force=options.force, external_host='zulipdev.com:9981')
|
||||
|
||||
test_the_api(client, nonadmin_client)
|
||||
test_generated_curl_examples_for_success(client)
|
||||
test_js_bindings(client)
|
||||
|
||||
# Test error payloads
|
||||
client = Client(
|
||||
|
Reference in New Issue
Block a user