feat: init
This commit is contained in:
7
node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.d.ts
generated
vendored
Normal file
7
node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.d.ts
generated
vendored
Normal file
@@ -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;
|
||||
26
node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js
generated
vendored
Normal file
26
node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js
generated
vendored
Normal file
@@ -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
|
||||
1
node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js.map
generated
vendored
Normal file
1
node_modules/@kwsites/file-exists/dist/test/__mocks__/fs.js.map
generated
vendored
Normal file
@@ -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"}
|
||||
Reference in New Issue
Block a user