createFakeExDevError = () => {
  // Properties captured by using fs.renameSync in the Node v12.20.1 REPL
  const fakeCrossDeviceError = new Error(
    "Error: EXDEV: cross-device link not permitted, rename '/foo/bar' -> '/bar/baz'",
  )
  // This is the important property that safeMoveFile looks for
  // to fallback to copy then rename behaviour
  fakeCrossDeviceError.code = 'EXDEV'

  // These other properties aren't used but it doesn't hurt to have an accurate error object
  fakeCrossDeviceError.errno = -18
  fakeCrossDeviceError.syscall = 'rename'
  fakeCrossDeviceError.path = '/foo/bar'
  fakeCrossDeviceError.dest = '/bar/baz'
  return fakeCrossDeviceError
}
Returns and Error object that resembles the EXDEV errors that are thrown
when you try to rename across device boundaries.

@returns an Error object that resembles the EXDEV errors are thrown