code: def test_to_json_image(mocker):
      image_renderer = mocker.MagicMock()
      image_renderer.TYPE = "image"
      image_renderer.datapoints = [
          {SRC: "contentfoo", REVISION: "foo"},
          {SRC: "contentbar", REVISION: "bar"},
      ]
      result = to_json(image_renderer)
      assert result[0] == {
          "url": image_renderer.datapoints[0].get(SRC),
          REVISIONS: [image_renderer.datapoints[0].get(REVISION)],
          TYPE_KEY: image_renderer.TYPE,
      }
  
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 3 for calling a global function with example usage: test_to_json_image(mocker) without return types