exported functions are also mocked in the package environment (as returned by as.environment("package:<pkg-name>") ), but only if the package is loaded