I guess filename should be path, and giving reporter = "greedy" does not work with my setting.
But this seems to work:
```
.test_code <- function(code, reporter = GreedyReporter$new(),
                       path = tempfile(fileext = ".R")) {
  writeLines(code, path)
  on.exit(unlink(path))
  
  test_file(path, reporter)$results
}
```