MCPcopy
hub / github.com/webpack/webpack / createTempFixture

Function createTempFixture

test/Compiler-caching.test.js:166–185  ·  view source on GitHub ↗

* @returns {{ rootPath: string, aFilepath: string, cFilepath: string }} temp fixture paths

()

Source from the content-addressed store, hash-verified

164 * @returns {{ rootPath: string, aFilepath: string, cFilepath: string }} temp fixture paths
165 */
166 function createTempFixture() {
167 const fixturePath = `${tempFixturePath}-${fixtureCount}`;
168 const aFilepath = path.join(fixturePath, "a.js");
169 const cFilepath = path.join(fixturePath, "c.js");
170
171 // Remove previous copy if present
172 rimraf.sync(fixturePath);
173
174 // Copy over file since we"ll be modifying some of them
175 fs.mkdirSync(fixturePath);
176 fs.copyFileSync(path.join(__dirname, "fixtures", "a.js"), aFilepath);
177 fs.copyFileSync(path.join(__dirname, "fixtures", "c.js"), cFilepath);
178
179 fixtureCount++;
180 return {
181 rootPath: fixturePath,
182 aFilepath,
183 cFilepath
184 };
185 }
186
187 it("should cache single file (with manual 1s wait)", (done) => {
188 const options = {};

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected