Add a test to make sure it errors if the `mode` is not `FILE` or `DIRECTORY` as per my comment above.