code: def test_show_json(mocker, capsys, dvc):
      args = parse_args(["diff", "--json"])
      cmd = args.func(args)
      diff = {
          "added": [
              {"path": "file2", "hash": "22222222"},
              {"path": "file1", "hash": "11111111"},
          ],
          "deleted": [],
          "modified": [],
          "not in cache": [],
      }
      mocker.patch("dvc.repo.Repo.diff", return_value=diff)
  
      assert cmd.run() == 0
      out, _ = capsys.readouterr()
      assert '"added": [{"path": "file1"}, {"path": "file2"}]' in out
      assert '"deleted": []' in out
      assert '"modified": []' in out
      assert '"not in cache": []' in out
  
file_path: dvc/tests/unit/command/test_diff.py
imports: import collections
  import os
  import pytest
  from dvc.cli import parse_args
  from dvc.commands.diff import _digest, _show_markdown
label_desc: Use image node_id 4 for calling a global function with example usage: test_show_json(mocker, capsys, dvc) without return types