Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ideffix committed Aug 20, 2021
1 parent 821fce2 commit 633dae1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,3 +454,18 @@ test('augmentChunkHash', async () => {
const barHash = barOne.fileName.split('.')[1]
expect(barHash).not.toEqual(fooHash) // Verify that foo and bar does not hash to the same
})

test('backslashEntryFilename', async () => {
const outDir = fixture('dist', 'backslashEntryFilename')
const file = 'simple/foo.css'
const newBundle = await rollup({
input: fixture(file),
plugins: [postcss({ extract: true })]
})
const { output } = await newBundle.write({
dir: outDir,
entryFileNames: 'test\\foo.[hash].css'
})
const hash = output[0].fileName.split('.')[1]
expect(hash).toBeTruthy() // Verify that [hash] part of `foo.[hash].css` is truthy
})

0 comments on commit 633dae1

Please sign in to comment.