Added a unit test to ensure that hashes are resolved correctly when used as the directory name holding the bundle file

This commit is contained in:
Sandeep Arneja 2016-03-16 12:20:08 -04:00
parent 419c2e6121
commit eb01c774f2
1 changed files with 12 additions and 0 deletions

View File

@ -355,6 +355,18 @@ describe('HtmlWebpackPlugin', function () {
}, [/<script src="index_bundle_[0-9a-f]+\.js"*/], null, done);
});
it('handles hashes in the directory which has the bundle file', function (done) {
testHtmlPlugin({
entry: path.join(__dirname, 'fixtures/index.js'),
output: {
path: path.join(__dirname, '../dist'),
publicPath: '/dist/[hash]/',
filename: 'index_bundle_[hash].js'
},
plugins: [new HtmlWebpackPlugin()]
}, [/<script src="\/dist\/[0-9a-f]+\/index_bundle_[0-9a-f]+\.js"*/], null, done);
});
it('allows to append hashes to the assets', function (done) {
testHtmlPlugin({
entry: path.join(__dirname, 'fixtures/index.js'),