def METHOD_NAME():
    """
    Test if it lists the NPM cache.
    """
    mock = MagicMock(return_value={"retcode": 1, "stderr": "error"})
    with patch.dict(npm.__salt__, {"cmd.run_all": mock}):
        pytest.raises(CommandExecutionError, npm.cache_list)
    mock = MagicMock(
        return_value={"retcode": 0, "stderr": "error", "stdout": ["~/.npm"]}
    )
    with patch.dict(npm.__salt__, {"cmd.run_all": mock}):
        assert npm.cache_list() == ["~/.npm"]
    mock = MagicMock(return_value={"retcode": 0, "stderr": "error", "stdout": ""})
    with patch.dict(npm.__salt__, {"cmd.run_all": mock}):
        assert npm.cache_list("coffee-script") == ""