odfjs/tests/basic-node.js
David Bruant 3da7f29cb0
Split text nodes so they contain at most one structuring block (#3)
* rename test folders

* failing test

* First promising result of splitting textNodes to enable {#each}{/each} block within a single text node

* tests passing

* cleanup
2025-04-26 19:59:44 +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'})
});