1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/test
Rafał Ruciński 7333dd622c Process available chunk names properly in dev mode (#4604)
Fixes #4603.

Tests explain it the best:

```js
    describe('development mode (no chunkhash)', () => {
      it('should strip the extension from the filename', () => {
        const filename = 'foo_bar_0123456789abcdef.js'
        expect(getChunkNameFromFilename(filename, true)).toBe('foo_bar_0123456789abcdef')
      })

      it('should only strip the extension even if there\'s a hyphen in the name', () => {
        const filename = 'foo-bar-0123456789abcdef.js'
        expect(getChunkNameFromFilename(filename, true)).toBe('foo-bar-0123456789abcdef')
      })
    })

    describe('production mode (with chunkhash)', () => {
      it('should strip the hash from the filename', () => {
        const filename = 'foo_bar_0123456789abcdef-0123456789abcdef.js'
        expect(getChunkNameFromFilename(filename, false)).toBe('foo_bar_0123456789abcdef')
      })

      it('should only strip the part after the last hyphen in the filename', () => {
        const filename = 'foo-bar-0123456789abcdef-0123456789abcdef.js'
        expect(getChunkNameFromFilename(filename, false)).toBe('foo-bar-0123456789abcdef')
      })
    })
```
2018-06-14 11:04:03 +02:00
..
integration Clean up references to this.dir and this.dist everywhere (#4535) 2018-06-04 15:45:39 +02:00
isolated Clean up references to this.dir and this.dist everywhere (#4535) 2018-06-04 15:45:39 +02:00
lib Add build manifest (#4119) 2018-04-12 09:47:42 +02:00
node_modules Handle empty assetPrefix scenario properly. (#3667) 2018-02-03 17:12:01 +01:00
unit Process available chunk names properly in dev mode (#4604) 2018-06-14 11:04:03 +02:00
.babelrc Speed up tests (#4102) 2018-04-03 14:43:56 +02:00
.gitignore Universal Webpack (#3578) 2018-01-30 16:44:44 +01:00