add test cases

This commit is contained in:
Tobias Koppers 2019-08-01 12:20:41 +02:00
parent 94bcce0b24
commit 53a7a342c5
6 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,3 @@
import("./module");
it("should run", () => {});

View File

@ -0,0 +1,21 @@
module.exports = {
output: {
futureEmitAssets: true
},
plugins: [
compiler => {
const files = {};
compiler.hooks.assetEmitted.tap("Test", (file, buffer) => {
files[file] = Buffer.isBuffer(buffer);
});
compiler.hooks.afterEmit.tap("Test", () => {
expect(files).toMatchInlineSnapshot(`
Object {
"1.bundle0.js": true,
"bundle0.js": true,
}
`);
});
}
]
};

View File

@ -0,0 +1,3 @@
import("./module");
it("should run", () => {});

View File

@ -0,0 +1,18 @@
module.exports = {
plugins: [
compiler => {
const files = {};
compiler.hooks.assetEmitted.tap("Test", (file, buffer) => {
files[file] = Buffer.isBuffer(buffer);
});
compiler.hooks.afterEmit.tap("Test", () => {
expect(files).toMatchInlineSnapshot(`
Object {
"1.bundle0.js": true,
"bundle0.js": true,
}
`);
});
}
]
};