code: function copyFileSync(src, dest) {
    if (!fs.lstatSync(src).isFile()) {
      throw new Error(`copyFileSync expected file but got: ${src}`);
    }
    fs.writeFileSync(dest, fs.readFileSync(src));
  }
docs: Mocking fs#copyFileSync (not implemented in memfs)