test(gz): blns

This commit is contained in:
MDLeom 2020-06-06 07:42:12 +01:00
parent e5ab822c45
commit bdb7e94350
No known key found for this signature in database
GPG Key ID: 21EA847C35D6E034
1 changed files with 22 additions and 0 deletions

View File

@ -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)
})
}
})
})