odfjs/tests/basic-node.js
2025-04-21 20:46:09 +02:00

20 lines
547 B
JavaScript

import {readFile} from 'node:fs/promises'
import test from 'ava';
import {getODSTableRawContent} from '../exports.js'
const nomAgeContent = (await readFile('./tests/fixtures/nom-age.ods')).buffer
test('basic', async t => {
const table = await getODSTableRawContent(nomAgeContent);
t.assert(table.has('Feuille1'))
const feuille1 = table.get('Feuille1')
t.assert(Array.isArray(feuille1))
//@ts-ignore
t.assert(Array.isArray(feuille1[0]))
//@ts-ignore
t.deepEqual(feuille1[0][0], {value: 'Nom', type: 'string'})
});