code: def test_plots_diff_json(dvc, mocker, capsys):
      cli_args = parse_args(
          [
              "plots",
              "diff",
              "HEAD~10",
              "HEAD~1",
              "--json",
              "--split",
              "--targets",
              "plot.csv",
              "-o",
              "out",
          ]
      )
      cmd = cli_args.func(cli_args)
  
      data = mocker.MagicMock()
      mocker.patch("dvc.repo.plots.diff.diff", return_value=data)
  
      renderers = mocker.MagicMock()
      mocker.patch(
          "dvc.render.match.match_defs_renderers",
          return_value=renderers,
      )
      render_mock = mocker.patch("dvc_render.render_html")
  
      show_json_mock = mocker.patch("dvc.commands.plots._show_json")
  
      assert cmd.run() == 0
  
      show_json_mock.assert_called_once_with(renderers, True, errors={})
  
      render_mock.assert_not_called()
  
imports: import json
  import os
  import posixpath
  from pathlib import Path
  import pytest
  from funcy import set_in
  from dvc.cli import parse_args
  from dvc.commands.plots import CmdPlotsDiff, CmdPlotsShow, CmdPlotsTemplates
  from dvc.render.match import RendererWithErrors
  from dvc.utils.serialize import YAMLFileCorruptedError
label_desc: Use image node_id 11 for calling a global function with example usage: test_plots_diff_json(dvc, mocker, capsys) without return types