code: def test_spec_to_html(requirejs, fullhtml, spec):
      # We can't test that the html actually renders, but we'll test aspects of
      # it to make certain that the keywords are respected.
      vegaembed_version = ("3.12",)
      vegalite_version = ("3.0",)
      vega_version = "4.0"
  
      html = spec_to_html(
          spec,
          mode="vega-lite",
          requirejs=requirejs,
          fullhtml=fullhtml,
          vegalite_version=vegalite_version,
          vegaembed_version=vegaembed_version,
          vega_version=vega_version,
      )
      html = html.strip()
  
      if fullhtml:
          assert html.startswith("<!DOCTYPE html>")
          assert html.endswith("</html>")
      else:
          assert html.startswith("<style>")
          assert html.endswith("</script>")
  
      if requirejs:
          assert "require(" in html
      else:
          assert "require(" not in html
  
      assert "vega-lite@{}".format(vegalite_version) in html
      assert "vega@{}".format(vega_version) in html
      assert "vega-embed@{}".format(vegaembed_version) in html
  
imports: import pytest
  from altair.utils.html import spec_to_html
label_desc: Use image node_id 2 for calling a global function with example usage: test_spec_to_html(requirejs, fullhtml, spec) without return types