From 6cf15c7d044121712df10d3ad118e3fb8b0bacc7 Mon Sep 17 00:00:00 2001 From: David Bruant Date: Mon, 21 Apr 2025 20:46:09 +0200 Subject: [PATCH] rename test folders --- tests/basic-node.js | 2 +- tests/fill-odt-template.js | 18 +++++++++--------- .../{data => fixtures}/cellule avec sauts.ods | Bin .../cellules avec dates.ods | Bin .../cellules-répétées.ods | Bin tests/{data => fixtures}/enum-courses.odt | Bin tests/{data => fixtures}/liste-courses.odt | Bin .../liste-fruits-et-légumes.odt | Bin .../{data => fixtures}/légumes-de-saison.odt | Bin tests/{data => fixtures}/nom-age.ods | Bin tests/{data => fixtures}/tableau-simple.odt | Bin .../template-anniversaire.odt | Bin .../template-avec-image.odt | Bin tests/{_helpers => helpers}/zip-analysis.js | 0 tests/ods-files.js | 6 +++--- 15 files changed, 13 insertions(+), 13 deletions(-) rename tests/{data => fixtures}/cellule avec sauts.ods (100%) rename tests/{data => fixtures}/cellules avec dates.ods (100%) rename tests/{data => fixtures}/cellules-répétées.ods (100%) rename tests/{data => fixtures}/enum-courses.odt (100%) rename tests/{data => fixtures}/liste-courses.odt (100%) rename tests/{data => fixtures}/liste-fruits-et-légumes.odt (100%) rename tests/{data => fixtures}/légumes-de-saison.odt (100%) rename tests/{data => fixtures}/nom-age.ods (100%) rename tests/{data => fixtures}/tableau-simple.odt (100%) rename tests/{data => fixtures}/template-anniversaire.odt (100%) rename tests/{data => fixtures}/template-avec-image.odt (100%) rename tests/{_helpers => helpers}/zip-analysis.js (100%) diff --git a/tests/basic-node.js b/tests/basic-node.js index 5f538c4..fb07e98 100644 --- a/tests/basic-node.js +++ b/tests/basic-node.js @@ -4,7 +4,7 @@ import test from 'ava'; import {getODSTableRawContent} from '../exports.js' -const nomAgeContent = (await readFile('./tests/data/nom-age.ods')).buffer +const nomAgeContent = (await readFile('./tests/fixtures/nom-age.ods')).buffer test('basic', async t => { const table = await getODSTableRawContent(nomAgeContent); diff --git a/tests/fill-odt-template.js b/tests/fill-odt-template.js index dcec8b4..6140480 100644 --- a/tests/fill-odt-template.js +++ b/tests/fill-odt-template.js @@ -4,11 +4,11 @@ import {join} from 'node:path'; import {getOdtTemplate} from '../scripts/odf/odtTemplate-forNode.js' import {fillOdtTemplate, getOdtTextContent} from '../exports.js' -import { listZipEntries } from './_helpers/zip-analysis.js'; +import { listZipEntries } from './helpers/zip-analysis.js'; test('basic template filling with variable substitution', async t => { - const templatePath = join(import.meta.dirname, './data/template-anniversaire.odt') + const templatePath = join(import.meta.dirname, './fixtures/template-anniversaire.odt') const templateContent = `Yo {nom} ! Tu es né.e le {dateNaissance} @@ -38,7 +38,7 @@ Bonjoir ☀️ test('basic template filling with {#each}', async t => { - const templatePath = join(import.meta.dirname, './data/enum-courses.odt') + const templatePath = join(import.meta.dirname, './fixtures/enum-courses.odt') const templateContent = `🧺 La liste de courses incroyable 🧺 {#each listeCourses as élément} @@ -74,7 +74,7 @@ Pâtes à lasagne (fraîches !) }); test('Filling with {#each} and non-iterable value results in no error and empty result', async t => { - const templatePath = join(import.meta.dirname, './data/enum-courses.odt') + const templatePath = join(import.meta.dirname, './fixtures/enum-courses.odt') const templateContent = `🧺 La liste de courses incroyable 🧺 {#each listeCourses as élément} @@ -105,7 +105,7 @@ test('Filling with {#each} and non-iterable value results in no error and empty test('template filling with {#each} generating a list', async t => { - const templatePath = join(import.meta.dirname, './data/liste-courses.odt') + const templatePath = join(import.meta.dirname, './fixtures/liste-courses.odt') const templateContent = `🧺 La liste de courses incroyable 🧺 - {#each listeCourses as élément} @@ -142,7 +142,7 @@ test('template filling with {#each} generating a list', async t => { test('template filling with 2 sequential {#each}', async t => { - const templatePath = join(import.meta.dirname, './data/liste-fruits-et-légumes.odt') + const templatePath = join(import.meta.dirname, './fixtures/liste-fruits-et-légumes.odt') const templateContent = `Liste de fruits et légumes Fruits @@ -195,7 +195,7 @@ Poivron 🫑 test('template filling with nested {#each}s', async t => { - const templatePath = join(import.meta.dirname, './data/légumes-de-saison.odt') + const templatePath = join(import.meta.dirname, './fixtures/légumes-de-saison.odt') const templateContent = `Légumes de saison {#each légumesSaison as saisonLégumes} @@ -281,7 +281,7 @@ Hiver test('template filling of a table', async t => { - const templatePath = join(import.meta.dirname, './data/tableau-simple.odt') + const templatePath = join(import.meta.dirname, './fixtures/tableau-simple.odt') const templateContent = `Évolution énergie en kWh par personne en France Année @@ -343,7 +343,7 @@ Année test('template filling preserves images', async t => { - const templatePath = join(import.meta.dirname, './data/template-avec-image.odt') + const templatePath = join(import.meta.dirname, './fixtures/template-avec-image.odt') const data = { commentaire : `J'adooooooore 🤩 West covinaaaaaaaaaaa 🎶` diff --git a/tests/data/cellule avec sauts.ods b/tests/fixtures/cellule avec sauts.ods similarity index 100% rename from tests/data/cellule avec sauts.ods rename to tests/fixtures/cellule avec sauts.ods diff --git a/tests/data/cellules avec dates.ods b/tests/fixtures/cellules avec dates.ods similarity index 100% rename from tests/data/cellules avec dates.ods rename to tests/fixtures/cellules avec dates.ods diff --git a/tests/data/cellules-répétées.ods b/tests/fixtures/cellules-répétées.ods similarity index 100% rename from tests/data/cellules-répétées.ods rename to tests/fixtures/cellules-répétées.ods diff --git a/tests/data/enum-courses.odt b/tests/fixtures/enum-courses.odt similarity index 100% rename from tests/data/enum-courses.odt rename to tests/fixtures/enum-courses.odt diff --git a/tests/data/liste-courses.odt b/tests/fixtures/liste-courses.odt similarity index 100% rename from tests/data/liste-courses.odt rename to tests/fixtures/liste-courses.odt diff --git a/tests/data/liste-fruits-et-légumes.odt b/tests/fixtures/liste-fruits-et-légumes.odt similarity index 100% rename from tests/data/liste-fruits-et-légumes.odt rename to tests/fixtures/liste-fruits-et-légumes.odt diff --git a/tests/data/légumes-de-saison.odt b/tests/fixtures/légumes-de-saison.odt similarity index 100% rename from tests/data/légumes-de-saison.odt rename to tests/fixtures/légumes-de-saison.odt diff --git a/tests/data/nom-age.ods b/tests/fixtures/nom-age.ods similarity index 100% rename from tests/data/nom-age.ods rename to tests/fixtures/nom-age.ods diff --git a/tests/data/tableau-simple.odt b/tests/fixtures/tableau-simple.odt similarity index 100% rename from tests/data/tableau-simple.odt rename to tests/fixtures/tableau-simple.odt diff --git a/tests/data/template-anniversaire.odt b/tests/fixtures/template-anniversaire.odt similarity index 100% rename from tests/data/template-anniversaire.odt rename to tests/fixtures/template-anniversaire.odt diff --git a/tests/data/template-avec-image.odt b/tests/fixtures/template-avec-image.odt similarity index 100% rename from tests/data/template-avec-image.odt rename to tests/fixtures/template-avec-image.odt diff --git a/tests/_helpers/zip-analysis.js b/tests/helpers/zip-analysis.js similarity index 100% rename from tests/_helpers/zip-analysis.js rename to tests/helpers/zip-analysis.js diff --git a/tests/ods-files.js b/tests/ods-files.js index 66017c9..5926b5b 100644 --- a/tests/ods-files.js +++ b/tests/ods-files.js @@ -5,7 +5,7 @@ import test from 'ava'; import {getODSTableRawContent} from '../exports.js' test('.ods file with table:number-columns-repeated attribute in cell', async t => { - const repeatedCellFileContent = (await readFile('./tests/data/cellules-répétées.ods')).buffer + const repeatedCellFileContent = (await readFile('./tests/fixtures/cellules-répétées.ods')).buffer const table = await getODSTableRawContent(repeatedCellFileContent); @@ -17,7 +17,7 @@ test('.ods file with table:number-columns-repeated attribute in cell', async t = test('.ods cells with dates should be recognized', async t => { - const odsFileWithDates = (await readFile('./tests/data/cellules avec dates.ods')).buffer + const odsFileWithDates = (await readFile('./tests/fixtures/cellules avec dates.ods')).buffer const table = await getODSTableRawContent(odsFileWithDates); const feuille1 = table.get('Feuille1') @@ -39,7 +39,7 @@ test('.ods cells with dates should be recognized', async t => { test('.ods file with new lines in content is ', async t => { - const repeatedCellFileContent = (await readFile('./tests/data/cellule avec sauts.ods')).buffer + const repeatedCellFileContent = (await readFile('./tests/fixtures/cellule avec sauts.ods')).buffer const table = await getODSTableRawContent(repeatedCellFileContent);