code: def test_params_diff_show_json(dvc, mocker, capsys):
      cli_args = parse_args(
          ["params", "diff", "HEAD~10", "HEAD~1", "--json"]
      )
      cmd = cli_args.func(cli_args)
      mocker.patch(
          "dvc.repo.params.diff.diff",
          return_value={
              "diff": {"params.yaml": {"a": "b"}},
              "errors": {"rev": Exception},
          },
      )
      show_diff_mock = mocker.patch("dvc.compare.show_diff")
  
      assert cmd.run() == 0
      out, _ = capsys.readouterr()
      assert '{"params.yaml": {"a": "b"}}\n' in out
      show_diff_mock.assert_not_called()
  
imports: from dvc.cli import parse_args
  from dvc.commands.params import CmdParamsDiff
label_desc: Use image node_id 3 for calling a global function with example usage: test_params_diff_show_json(dvc, mocker, capsys) without return types