aboutsummaryrefslogtreecommitdiff
path: root/node_modules/@kwsites/file-exists/dist/test/__mocks__
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@kwsites/file-exists/dist/test/__mocks__')
-rw-r--r--node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.d.ts7
-rw-r--r--node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js26
-rw-r--r--node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js.map1
3 files changed, 34 insertions, 0 deletions
diff --git a/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.d.ts b/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.d.ts
new file mode 100644
index 0000000..ab80d33
--- /dev/null
+++ b/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.d.ts
@@ -0,0 +1,7 @@
+export declare function statSync(...args: any[]): any;
+export declare function addStatSyncMock(fn: any): void;
+export declare function assertMocksUsed(): void;
+declare const mockFs: {
+ statSync: typeof statSync;
+};
+export default mockFs;
diff --git a/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js b/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js
new file mode 100644
index 0000000..cd46c71
--- /dev/null
+++ b/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js
@@ -0,0 +1,26 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+let statSyncMocks = [];
+function statSync(...args) {
+ const mock = statSyncMocks.shift();
+ if (typeof mock !== 'function') {
+ throw new Error(`fs.statSync called without configuring a mock`);
+ }
+ return mock(...args);
+}
+exports.statSync = statSync;
+function addStatSyncMock(fn) {
+ statSyncMocks.push(fn);
+}
+exports.addStatSyncMock = addStatSyncMock;
+function assertMocksUsed() {
+ if (statSyncMocks.length) {
+ throw new Error(`fs.afterEach: statSync has ${statSyncMocks.length} unused mocks`);
+ }
+}
+exports.assertMocksUsed = assertMocksUsed;
+const mockFs = {
+ statSync,
+};
+exports.default = mockFs;
+//# sourceMappingURL=fs.js.map \ No newline at end of file
diff --git a/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js.map b/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js.map
new file mode 100644
index 0000000..e2a3d16
--- /dev/null
+++ b/node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../../test/__mocks__/fs.ts"],"names":[],"mappings":";;AACA,IAAI,aAAa,GAAU,EAAE,CAAC;AAE9B,SAAgB,QAAQ,CAAC,GAAG,IAAW;IACpC,MAAO,IAAI,GAAG,aAAa,CAAC,KAAK,EAAE,CAAC;IACpC,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;QAC7B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;KACnE;IAED,OAAO,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;AACxB,CAAC;AAPD,4BAOC;AAED,SAAgB,eAAe,CAAC,EAAO;IACpC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1B,CAAC;AAFD,0CAEC;AAED,SAAgB,eAAe;IAC5B,IAAI,aAAa,CAAC,MAAM,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,8BAA8B,aAAa,CAAC,MAAM,eAAe,CAAC,CAAC;KACrF;AACJ,CAAC;AAJD,0CAIC;AAED,MAAM,MAAM,GAAG;IACZ,QAAQ;CACV,CAAA;AAED,kBAAe,MAAM,CAAC"} \ No newline at end of file