mirror of https://github.com/curbengh/hexo-yam
test(gz): blns
This commit is contained in:
parent
e5ab822c45
commit
bdb7e94350
|
@ -229,4 +229,26 @@ describe('gzip', () => {
|
|||
|
||||
expect(routeList).toEqual(expect.arrayContaining(expected))
|
||||
})
|
||||
|
||||
test('blns', async () => {
|
||||
const blns = require('./fixtures/blns.json')
|
||||
|
||||
for (const nStr of blns) {
|
||||
hexo.route.remove(path)
|
||||
|
||||
hexo.route.set(path, nStr)
|
||||
|
||||
await g()
|
||||
|
||||
const output = hexo.route.get(path.concat('.gz'))
|
||||
const buf = []
|
||||
output.on('data', (chunk) => (buf.push(chunk)))
|
||||
output.on('end', async () => {
|
||||
const result = Buffer.concat(buf)
|
||||
const resultUnzip = await unzip(result)
|
||||
|
||||
expect(resultUnzip.toString()).toBe(nStr)
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue