odfjs/tests/create-ods-file.js
David Bruant 57e0145ec7
Create ods file (#5)
* Ajout de création de fichier .ods

* Ajout d'un outil pour créer un fichier .ods + rajout de styles.xml et meta.xml pour peut-être plaire à LibreOffice

* Créer des fichiers considérés corrompus-mais-réparables LibreOffice

* Creating libre-office-validated ods files

* readme with ods creation
2024-10-23 19:13:29 +02:00

35 lines
775 B
JavaScript

import test from 'ava';
import {getODSTableRawContent, createOdsFile} from '../scripts/node.js'
test('basic file creation', async t => {
const content = new Map([
[
'La feuille',
[
[
{value: 'azerty', type: 'string'},
{value: '37', type: 'float'}
]
]
]
])
// @ts-ignore
const odsFile = await createOdsFile(content)
const parsedContent = await getODSTableRawContent(odsFile)
t.assert(parsedContent.has('La feuille'))
const feuille = parsedContent.get('La feuille')
t.deepEqual(feuille, [
[
{value: 'azerty', type: 'string'},
{value: '37', type: 'float'}
]
])
});