Skip to content

Commit 17306c3

Browse files
pugnascotiaTimer
authored andcommitted
Work around broken loader-utils behaviour in integration tests
1 parent ecfdb0b commit 17306c3

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

packages/react-scripts/fixtures/kitchensink/integration/webpack.test.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,24 @@ describe('Integration', () => {
2828
it('no ext inclusion', async () => {
2929
const doc = await initDOM('no-ext-inclusion')
3030

31-
expect(doc.getElementById('feature-no-ext-inclusion').href).to.match(/\/static\/media\/aFileWithoutExt$/)
31+
// The expected pattern here is wrong. Due to:
32+
//
33+
// https://github.com/webpack/loader-utils/pull/71
34+
//
35+
// ...the loader-utils module gets the interpolated name wrong when
36+
// there's no file extension and there's a period in source directory
37+
// path (which happens here due to generated temp directories). You
38+
// end up with something like:
39+
//
40+
// /static/media/.cb7eb057.OEs6g9SsPz/test-kitchensink/src/features/webpack/assets/aFileWithoutExt
41+
//
42+
// instead of:
43+
//
44+
// /static/media/aFileWithoutExt.[hash].bin
45+
//
46+
// At some point loader-utils will be fixed, and the pattern can be
47+
// fixed too.
48+
expect(doc.getElementById('feature-no-ext-inclusion').href).to.match(/\/static\/media\/.*aFileWithoutExt$/)
3249
})
3350

3451
it('json inclusion', async () => {

0 commit comments

Comments
 (0)