code: def test_js_function(app):
      text = ".. js:function:: sum(a, b)"
      doctree = restructuredtext.parse(app, text)
      assert_node(
          doctree,
          (
              addnodes.index,
              [
                  desc,
                  (
                      [
                          desc_signature,
                          (
                              [desc_name, ([desc_sig_name, "sum"])],
                              desc_parameterlist,
                          ),
                      ],
                      [desc_content, ()],
                  ),
              ],
          ),
      )
      assert_node(
          doctree[1][0][1],
          [
              desc_parameterlist,
              (
                  [desc_parameter, ([desc_sig_name, "a"])],
                  [desc_parameter, ([desc_sig_name, "b"])],
              ),
          ],
      )
      assert_node(
          doctree[0],
          addnodes.index,
          entries=[
              ("single", "sum() (built-in function)", "sum", "", None)
          ],
      )
      assert_node(
          doctree[1],
          addnodes.desc,
          domain="js",
          objtype="function",
          no_index=False,
      )
  
imports: from unittest.mock import Mock
  import docutils.utils
  import pytest
  from docutils import nodes
  from sphinx import addnodes
  from sphinx.addnodes import desc, desc_annotation, desc_content, desc_name, desc_parameter, desc_parameterlist, desc_sig_keyword, desc_sig_name, desc_sig_space, desc_signature
  from sphinx.domains.javascript import JavaScriptDomain
  from sphinx.testing import restructuredtext
  from sphinx.testing.util import assert_node
  from sphinx.writers.text import STDINDENT
label_desc: Use image node_id 6 for calling a global function with example usage: test_js_function(app) without return types