Skip to content

Commit

Permalink
test: failing test when using multiple instances
Browse files Browse the repository at this point in the history
reproduce #100
  • Loading branch information
Aaron Bernstein authored and mastilver committed Nov 22, 2017
1 parent 409b0fb commit b6dc017
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions spec/plugin.integration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,40 @@ describe('ManifestPlugin using real fs', function() {
});
});

it('still works when there are multiple instances of the plugin', function(done) {
webpackCompile({
context: __dirname,
output: {
filename: '[name].js',
path: path.join(__dirname, 'output/single-file')
},
entry: './fixtures/file.js',
plugins: [
new ManifestPlugin({fileName: 'manifest1.json'}),
new ManifestPlugin({fileName: 'manifest2.json'})
]
}, {}, function(stats) {

expect(stats.compilation.assets['main.js'].emitted).toBe(true);
expect(stats.compilation.assets['manifest1.json'].emitted).toBe(true);
expect(stats.compilation.assets['manifest2.json'].emitted).toBe(true);

var manifest1 = JSON.parse(fse.readFileSync(path.join(__dirname, 'output/single-file/manifest1.json')))
expect(manifest1).toBeDefined();
expect(manifest1).toEqual({
'main.js': 'main.js'
});

var manifest2 = JSON.parse(fse.readFileSync(path.join(__dirname, 'output/single-file/manifest2.json')))
expect(manifest2).toBeDefined();
expect(manifest2).toEqual({
'main.js': 'main.js'
});

done();
});
});

it('exposes a plugin hook with the manifest content', function (done) {
function TestPlugin() {
this.manifest = null;
Expand Down

0 comments on commit b6dc017

Please sign in to comment.