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

Function createTempFixture

test/Compiler-filesystem-caching.test.js:234–256  ·  view source on GitHub ↗

* @returns {{ rootPath: string, usesAssetFilepath: string, svgFilepath: string }} temp fixture paths

()

Source from the content-addressed store, hash-verified

232 * @returns {{ rootPath: string, usesAssetFilepath: string, svgFilepath: string }} temp fixture paths
233 */
234 function createTempFixture() {
235 const fixturePath = `${tempFixturePath}-${fixtureCount}`;
236 const usesAssetFilepath = path.join(fixturePath, "uses-asset.js");
237 const svgFilepath = path.join(fixturePath, "file.svg");
238
239 // Remove previous copy if present
240 rimraf.sync(fixturePath);
241
242 // Copy over file since we"ll be modifying some of them
243 fs.mkdirSync(fixturePath);
244 fs.copyFileSync(
245 path.join(__dirname, "fixtures", "uses-asset.js"),
246 usesAssetFilepath
247 );
248 fs.copyFileSync(path.join(__dirname, "fixtures", "file.svg"), svgFilepath);
249
250 fixtureCount++;
251 return {
252 rootPath: fixturePath,
253 usesAssetFilepath,
254 svgFilepath
255 };
256 }
257
258 it("should compile again when cached asset has changed but loader output remains the same", (done) => {
259 const tempFixture = createTempFixture();

Calls

no outgoing calls

Tested by

no test coverage detected