From 4d0cb87f89afb9210e029d08ac8968c5c67c625e Mon Sep 17 00:00:00 2001 From: Doug Parker Date: Tue, 28 Feb 2023 23:15:04 -0800 Subject: [PATCH] Deletes `fs` module. Refs #33. This module's entire purpose was to proxy the underlying Node.js `fs` module in a way which could be spied upon. However, in native ESM we can't spy on even user modules which are imported. We already have `FileSystem` and `FileSystemFake` as a replacement and all tests were successfully migrated to it, so `fs` is no longer needed. --- common/BUILD.bazel | 7 ------- common/fs.ts | 32 -------------------------------- 2 files changed, 39 deletions(-) delete mode 100644 common/fs.ts diff --git a/common/BUILD.bazel b/common/BUILD.bazel index c87db2c0..4305e378 100644 --- a/common/BUILD.bazel +++ b/common/BUILD.bazel @@ -68,13 +68,6 @@ jasmine_node_test( deps = [":formatters_test_lib"], ) -ts_project( - name = "fs", - srcs = ["fs.ts"], - visibility = ["//visibility:public"], - deps = ["//:node_modules/@types/node"], -) - ts_project( name = "file_system", srcs = ["file_system.ts"], diff --git a/common/fs.ts b/common/fs.ts deleted file mode 100644 index 923be3f3..00000000 --- a/common/fs.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { promises as fs } from 'fs'; - -// Re-export `fs` functionality in a separate object that can be spied upon. -// Must manually re-export each specific member so they are imported in the same -// manner as the real `fs` module. Note that these are the promisified versions -// of the module. -export const { - access, - appendFile, - chmod, - chown, - copyFile, - lchmod, - lchown, - link, - lstat, - mkdir, - mkdtemp, - open, - readdir, - readFile, - readlink, - realpath, - rename, - rmdir, - stat, - symlink, - truncate, - unlink, - utimes, - writeFile, -} = fs;