Skip to content

Commit f27998b

Browse files
pugnascotiaTimer
authored andcommitted
Update test now that webpack/loader-utils has been updated
1 parent 9baee05 commit f27998b

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

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

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

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$/)
31+
expect(doc.getElementById('feature-no-ext-inclusion').href).to.match(/\/static\/media\/aFileWithoutExt\.[a-f0-9]{8}\.bin$/)
4932
})
5033

5134
it('json inclusion', async () => {
@@ -63,7 +46,7 @@ describe('Integration', () => {
6346
it('unknown ext inclusion', async () => {
6447
const doc = await initDOM('unknown-ext-inclusion')
6548

66-
expect(doc.getElementById('feature-unknown-ext-inclusion').href).to.match(/\/static\/media\/aFileWithExt\.[a-f0-9]{8}\.unknown$/);
49+
expect(doc.getElementById('feature-unknown-ext-inclusion').href).to.match(/\/static\/media\/aFileWithExt\.[a-f0-9]{8}\.unknown$/)
6750
})
6851
})
6952
})

0 commit comments

Comments
 (0)