From 2b726e8031e896ddbb5634e336554d366e08e1fc Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Mon, 23 Nov 2015 14:08:25 +0100 Subject: [PATCH] Add unit tests for chunk sort --- spec/HtmlWebpackPluginSpec.js | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/spec/HtmlWebpackPluginSpec.js b/spec/HtmlWebpackPluginSpec.js index 78fb1e5..0897466 100644 --- a/spec/HtmlWebpackPluginSpec.js +++ b/spec/HtmlWebpackPluginSpec.js @@ -663,4 +663,50 @@ describe('HtmlWebpackPlugin', function() { }, ["HtmlWebpackPlugin Error: Child compilation failed:\nEntry module not found: Error: Cannot resolve 'file' or 'directory'"], null, done, true); }); + it('should short the chunks', function(done) { + testHtmlPlugin({ + entry: { + util: path.join(__dirname, 'fixtures/util.js'), + index: path.join(__dirname, 'fixtures/index.js') + }, + output: { + path: OUTPUT_DIR, + filename: '[name]_bundle.js' + }, + plugins: [ + new CommonsChunkPlugin({ + name: 'common', + filename: "common_bundle.js", + }), + new HtmlWebpackPlugin({ + chunksSortMode: 'auto' + }) + ] + }, [ + /