- json2xls-worker-thread.git
- test
- mocha
- generate-xls.js
This file ( 741B ) exceeds the allowed full mode (48 kb) size.
The editor full hight is disabled, only scrolling is allowed..
If you wish to edit a file, it is recommended to use the scroll mode as some users do not like the full height
mode, although some users like it.
const assert = require('assert');
const data = require('../fixtures/array-data')
const json2xls = require('../../src')
describe('generate-xls', () => {
it('check binary', async () => {
const xlsBinary = await json2xls(data)
assert.ok(xlsBinary.slice(0, 2) === 'PK')
})
it('check base64', async () => {
const xlsBase64 = await json2xls(data, {
output: 'base64'
})
assert.ok(xlsBase64 === Buffer.from(xlsBase64, 'base64').toString('base64'))
})
it('check base64 sync', () => {
const xlsBase64 = json2xls.sync(data, {
output: 'base64'
})
assert.ok(xlsBase64 === Buffer.from(xlsBase64, 'base64').toString('base64'))
})
})