MCPcopy
hub / github.com/webpack/webpack / createFs

Function createFs

test/FileSystemInfo.unittest.js:75–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73 const managedPaths = ["/path/node_modules"];
74 const immutablePaths = ["/path/cache"];
75 const createFs = () => {
76 const fs = createFsFromVolume(new Volume());
77 fs.mkdirSync("/path/context+files/sub", { recursive: true });
78 fs.mkdirSync("/path/context/sub", { recursive: true });
79 fs.mkdirSync("/path/nested/deep", { recursive: true });
80 fs.mkdirSync("/path/node_modules/package", { recursive: true });
81 fs.mkdirSync("/path/node_modules/@foo", { recursive: true });
82 fs.mkdirSync("/path/node_modules/@foo/package1", { recursive: true });
83 fs.mkdirSync("/path/node_modules/@foo/package2", { recursive: true });
84 fs.mkdirSync("/path/node_modules/bar-package3", { recursive: true });
85 fs.mkdirSync("/path/cache/package-1234", { recursive: true });
86 fs.mkdirSync("/path/folder/context", { recursive: true });
87 fs.mkdirSync("/path/folder/context+files", { recursive: true });
88 fs.mkdirSync("/path/folder/nested", { recursive: true });
89 fs.writeFileSync("/path/file.txt", "Hello World");
90 fs.writeFileSync("/path/file2.txt", "Hello World2");
91 fs.writeFileSync("/path/nested/deep/file.txt", "Hello World");
92 fs.writeFileSync("/path/nested/deep/ignored.txt", "Ignored");
93 fs.writeFileSync("/path/context+files/file.txt", "Hello World");
94 fs.writeFileSync("/path/context+files/file2.txt", "Hello World2");
95 fs.writeFileSync("/path/context+files/sub/file.txt", "Hello World");
96 fs.writeFileSync("/path/context+files/sub/file2.txt", "Hello World2");
97 fs.writeFileSync("/path/context+files/sub/file3.txt", "Hello World3");
98 fs.writeFileSync("/path/context+files/sub/ignored.txt", "Ignored");
99 fs.writeFileSync("/path/context/file.txt", "Hello World");
100 fs.writeFileSync("/path/context/file2.txt", "Hello World2");
101 fs.writeFileSync("/path/context/sub/file.txt", "Hello World");
102 fs.writeFileSync("/path/context/sub/file2.txt", "Hello World2");
103 fs.writeFileSync("/path/context/sub/file3.txt", "Hello World3");
104 fs.writeFileSync("/path/context/sub/ignored.txt", "Ignored");
105 fs.writeFileSync(
106 "/path/node_modules/package/package.json",
107 JSON.stringify({ name: "package", version: "1.0.0" })
108 );
109 fs.writeFileSync("/path/node_modules/package/file.txt", "Hello World");
110 fs.writeFileSync("/path/node_modules/package/ignored.txt", "Ignored");
111 fs.writeFileSync(
112 "/path/cache/package-1234/package.json",
113 JSON.stringify({ name: "package", version: "1.0.0" })
114 );
115 fs.writeFileSync("/path/cache/package-1234/file.txt", "Hello World");
116 fs.writeFileSync("/path/cache/package-1234/ignored.txt", "Ignored");
117 fs.symlinkSync("/path", "/path/circular", "dir");
118 fs.writeFileSync("/path/folder/context/file.txt", "Hello World");
119 fs.writeFileSync("/path/folder/context+files/file.txt", "Hello World");
120 fs.writeFileSync("/path/folder/nested/file.txt", "Hello World");
121 fs.writeFileSync(
122 "/path/node_modules/@foo/package1/index.js",
123 "Hello World"
124 );
125 fs.writeFileSync(
126 "/path/node_modules/@foo/package2/index.js",
127 "Hello World"
128 );
129 fs.writeFileSync("/path/node_modules/bar-package3/index.js", "Hello World");
130 fs.symlinkSync("/path/folder/context", "/path/context/sub/symlink", "dir");
131 fs.symlinkSync(
132 "/path/folder/context+files",

Callers 4

getSnapshotFunction · 0.85
buildFsInfoWithSnapshotFunction · 0.85
buildWithStatsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected