Skip to content

Instantly share code, notes, and snippets.

@anikethsaha
Created April 5, 2020 11:22
Show Gist options
  • Save anikethsaha/70530cea92532b2c83019cf1b0c1a4ac to your computer and use it in GitHub Desktop.
Save anikethsaha/70530cea92532b2c83019cf1b0c1a4ac to your computer and use it in GitHub Desktop.
Trying to test deterministicChunkIdsPlugin.test.js
"use strict";
const path = require("path");
const webpack = require("../");
const { createFsFromVolume, Volume } = require("memfs");
const deterministicChunkIdsPlugin = require("../lib/ids/DeterministicChunkIdsPlugin");
describe("deterministic Plugin tests", () => {
jest.setTimeout(20000);
it("should run the chunk ids as a determinitic one", () => {
const compiler = createSimpleCompiler();
compiler.run((err, stats) => {
if (err) throw err;
console.log(stats); // Nothing is printing here
});
});
});
const createSimpleCompiler = (options = {}) => {
const compiler = webpack({
context: path.join(__dirname, "fixtures"),
entry: "./a.js"
});
compiler.outputFileSystem = createFsFromVolume(new Volume());
new deterministicChunkIdsPlugin().apply(compiler);
return compiler;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment