Skip to content

Commit

Permalink
add bundle hash test
Browse files Browse the repository at this point in the history
  • Loading branch information
DeMoorJasper committed Aug 27, 2018
1 parent 804a8a8 commit 2bdb00b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/bundler.js
Expand Up @@ -96,4 +96,26 @@ describe('bundler', function() {
}
]);
});

it('Should pick a new asset id if there is a duplicate', async function() {
let b = await bundle(
__dirname + '/integration/asset-id-resizing/index.js',
{
production: true
}
);

let idArray = Array.from(b.assets.values()).map(asset => asset.id);
assert(idArray[0] !== idArray[1]);
assert(idArray[1].length === 4);
await assertBundleTree(b, {
type: 'js',
assets: ['index.js', 'fsrfyf.js'],
childBundles: [
{
type: 'map'
}
]
});
});
});
3 changes: 3 additions & 0 deletions test/integration/asset-id-resizing/fsrfyf.js
@@ -0,0 +1,3 @@
module.exports = function() {
return 'other module';
}
2 changes: 2 additions & 0 deletions test/integration/asset-id-resizing/index.js
@@ -0,0 +1,2 @@
const other = require('./fsrfyf.js');
module.exports = other;

0 comments on commit 2bdb00b

Please sign in to comment.