Skip to content

Commit

Permalink
contentHashing
Browse files Browse the repository at this point in the history
  • Loading branch information
alshdavid committed Dec 12, 2024
1 parent 7bdb3d9 commit 09f2254
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/core/integration-tests/test/contentHashing.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @flow
import assert from 'assert';
import path from 'path';
import {
Expand Down Expand Up @@ -99,11 +100,19 @@ describe('content hashing', function () {
async () => {
let a = await _bundle(
path.join(__dirname, 'integration/hash-distDir/a/index.html'),
{sourceMaps: true},
{
defaultTargetOptions: {
sourceMaps: true,
},
},
);
let b = await _bundle(
path.join(__dirname, 'integration/hash-distDir/b/index.html'),
{sourceMaps: true},
{
defaultTargetOptions: {
sourceMaps: true,
},
},
);

let aBundles = a.getBundles();
Expand All @@ -113,7 +122,11 @@ describe('content hashing', function () {
assert.equal(bBundles.length, 2);

let aJS = aBundles.find((bundle) => bundle.type === 'js');
if (!aJS) return assert(false);

let bJS = bBundles.find((bundle) => bundle.type === 'js');
if (!bJS) return assert(false);

assert(/index\.[a-f0-9]*\.js/.test(path.basename(aJS.filePath)));
assert.equal(aJS.name, bJS.name);
},
Expand Down

0 comments on commit 09f2254

Please sign in to comment.