code: def test_to_json_vega(mocker):
      vega_renderer = mocker.MagicMock()
      vega_renderer.TYPE = "vega"
      vega_renderer.get_revs.return_value = ["bar", "foo"]
      vega_renderer.get_filled_template.return_value = {
          "this": "is vega"
      }
      result = to_json(vega_renderer)
      assert result[0] == {
          TYPE_KEY: vega_renderer.TYPE,
          REVISIONS: ["bar", "foo"],
          "content": {"this": "is vega"},
      }
      vega_renderer.get_filled_template.assert_called()
  
imports: import json
  import pytest
  from dvc.render import ANCHOR_DEFINITIONS, FILENAME, REVISION, REVISIONS, SRC, TYPE_KEY
  from dvc.render.convert import to_json
label_desc: Use image node_id 1 for calling a global function with example usage: test_to_json_vega(mocker) without return types