(
/** @type {(err: Error | null | undefined, fsInfo?: FsInfoExt) => void} */ callback
)
| 922 | * @param {(err: Error | null | undefined, fsInfo?: FsInfoExt) => void} callback result callback |
| 923 | */ |
| 924 | const buildWithStats = ( |
| 925 | /** @type {(err: Error | null | undefined, fsInfo?: FsInfoExt) => void} */ callback |
| 926 | ) => { |
| 927 | const fs = createFs(); |
| 928 | const fsInfo = createFsInfo(fs); |
| 929 | class="cm">// Two overlapping snapshots populate the optimization statistics so |
| 930 | class="cm">// `logStatistics` exercises its `logWhenMessage` branches. |
| 931 | fsInfo.createSnapshot( |
| 932 | Date.now() + 10000, |
| 933 | files, |
| 934 | directories, |
| 935 | missing, |
| 936 | { timestamp: true, hash: true }, |
| 937 | (err) => { |
| 938 | if (err) return callback(err); |
| 939 | fsInfo.createSnapshot( |
| 940 | Date.now() + 10000, |
| 941 | files, |
| 942 | directories, |
| 943 | missing, |
| 944 | { timestamp: true, hash: true }, |
| 945 | (err) => { |
| 946 | if (err) return callback(err); |
| 947 | callback(null, fsInfo); |
| 948 | } |
| 949 | ); |
| 950 | } |
| 951 | ); |
| 952 | }; |
| 953 | |
| 954 | it(class="st">"logStatistics() logs cache and optimization stats", (done) => { |
| 955 | buildWithStats((err, fsInfo_) => { |
no test coverage detected