MCPcopy
hub / github.com/webpack/webpack / buildWithStats

Function buildWithStats

test/FileSystemInfo.unittest.js:924–952  ·  test/FileSystemInfo.unittest.js::buildWithStats
(
			/** @type {(err: Error | null | undefined, fsInfo?: FsInfoExt) => void} */ callback
		)

Source from the content-addressed store, hash-verified

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_) => {

Callers 1

Calls 4

createFsFunction · 0.85
createFsInfoFunction · 0.85
createSnapshotMethod · 0.80
callbackFunction · 0.70

Tested by

no test coverage detected