diff --git a/package.json b/package.json index 9057df923..56cc126a8 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "timeago.js": "4.0.2" }, "scripts": { - "test": "mocha --color --require @babel/register src/scripts/tests/", + "test": "mocha --color --require @babel/register src/scripts/tests/unit/", "test:coverage": "nyc npm run test", "test-integration": "mocha --color --require @babel/register --bail --timeout 0 src/scripts/tests/integration/", "test-integration:ci": "mocha --color --require @babel/register --bail --timeout 15000 --retries=5 src/scripts/tests/integration/", diff --git a/src/scripts/tests/helpers.js b/src/scripts/tests/unit/helpers.js similarity index 99% rename from src/scripts/tests/helpers.js rename to src/scripts/tests/unit/helpers.js index 5b49a719e..c5ffbe873 100644 --- a/src/scripts/tests/helpers.js +++ b/src/scripts/tests/unit/helpers.js @@ -1,4 +1,4 @@ -import Profil from '../profil' +import Profil from '../../profil' export function createProfil({ symptomes_actuels = false, diff --git a/src/scripts/tests/test.affichage.js b/src/scripts/tests/unit/test.affichage.js similarity index 96% rename from src/scripts/tests/test.affichage.js rename to src/scripts/tests/unit/test.affichage.js index 26b86cf4a..1861da769 100644 --- a/src/scripts/tests/test.affichage.js +++ b/src/scripts/tests/unit/test.affichage.js @@ -1,7 +1,7 @@ import { assert } from 'chai' import { JSDOM } from 'jsdom' -import * as affichage from '../affichage' +import * as affichage from '../../affichage' describe('Affichage', function () { it('On peut masquer des éléments visibles', function () { diff --git a/src/scripts/tests/test.algorithme.deconfinement.js b/src/scripts/tests/unit/test.algorithme.deconfinement.js similarity index 99% rename from src/scripts/tests/test.algorithme.deconfinement.js rename to src/scripts/tests/unit/test.algorithme.deconfinement.js index 047581be1..195d33196 100644 --- a/src/scripts/tests/test.algorithme.deconfinement.js +++ b/src/scripts/tests/unit/test.algorithme.deconfinement.js @@ -1,9 +1,9 @@ import { assert } from 'chai' -import { joursAvant } from '../utils' -import AlgorithmeDeconfinement from '../algorithme/deconfinement' +import { joursAvant } from '../../utils' +import AlgorithmeDeconfinement from '../../algorithme/deconfinement' -import Profil from '../profil' +import Profil from '../../profil' describe('Algorithme déconfinement', function () { describe('Quarantaine pour tous', function () { diff --git a/src/scripts/tests/test.algorithme.depistage.js b/src/scripts/tests/unit/test.algorithme.depistage.js similarity index 98% rename from src/scripts/tests/test.algorithme.depistage.js rename to src/scripts/tests/unit/test.algorithme.depistage.js index 2b2d1c3ca..ea1d71dc4 100644 --- a/src/scripts/tests/test.algorithme.depistage.js +++ b/src/scripts/tests/unit/test.algorithme.depistage.js @@ -1,8 +1,8 @@ import { assert } from 'chai' -import { joursAvant } from '../utils' +import { joursAvant } from '../../utils' -import Profil from '../profil' +import Profil from '../../profil' describe('Algorithme dépistage', function () { describe('Prise en compte d’un test positif', function () { diff --git a/src/scripts/tests/test.algorithme.orientation.js b/src/scripts/tests/unit/test.algorithme.orientation.js similarity index 99% rename from src/scripts/tests/test.algorithme.orientation.js rename to src/scripts/tests/unit/test.algorithme.orientation.js index 88370b7f3..be3fc24b6 100644 --- a/src/scripts/tests/test.algorithme.orientation.js +++ b/src/scripts/tests/unit/test.algorithme.orientation.js @@ -1,8 +1,8 @@ import { assert } from 'chai' -import { joursAvant } from '../utils' -import AlgorithmeOrientation from '../algorithme/orientation' -import Profil from '../profil' +import { joursAvant } from '../../utils' +import AlgorithmeOrientation from '../../algorithme/orientation' +import Profil from '../../profil' describe('Frise chronologique sur l’isolement', function () { describe('Pas de frise', function () { diff --git a/src/scripts/tests/test.algorithme.suivi.js b/src/scripts/tests/unit/test.algorithme.suivi.js similarity index 99% rename from src/scripts/tests/test.algorithme.suivi.js rename to src/scripts/tests/unit/test.algorithme.suivi.js index b84ae65ce..26eef26ff 100644 --- a/src/scripts/tests/test.algorithme.suivi.js +++ b/src/scripts/tests/unit/test.algorithme.suivi.js @@ -1,8 +1,8 @@ import { assert } from 'chai' -import AlgorithmeSuivi from '../algorithme/suivi' +import AlgorithmeSuivi from '../../algorithme/suivi' -import Profil from '../profil' +import Profil from '../../profil' describe('Algorithme auto-suivi', function () { describe('Gravité', function () { diff --git a/src/scripts/tests/test.algorithme.vaccination.js b/src/scripts/tests/unit/test.algorithme.vaccination.js similarity index 95% rename from src/scripts/tests/test.algorithme.vaccination.js rename to src/scripts/tests/unit/test.algorithme.vaccination.js index fbe06b983..449b8b289 100644 --- a/src/scripts/tests/test.algorithme.vaccination.js +++ b/src/scripts/tests/unit/test.algorithme.vaccination.js @@ -1,10 +1,10 @@ import { assert } from 'chai' -import AlgorithmeOrientation from '../algorithme/orientation' -import AlgorithmeVaccination from '../algorithme/vaccination' -import { joursAvant } from '../utils' +import AlgorithmeOrientation from '../../algorithme/orientation' +import AlgorithmeVaccination from '../../algorithme/vaccination' +import { joursAvant } from '../../utils' -import Profil from '../profil' +import Profil from '../../profil' describe('Vaccination', function () { describe('Pas de Covid passée', function () { diff --git a/src/scripts/tests/test.conseils.js b/src/scripts/tests/unit/test.conseils.js similarity index 97% rename from src/scripts/tests/test.conseils.js rename to src/scripts/tests/unit/test.conseils.js index c527209d2..a9fc9c828 100644 --- a/src/scripts/tests/test.conseils.js +++ b/src/scripts/tests/unit/test.conseils.js @@ -1,9 +1,9 @@ import { assert } from 'chai' import { JSDOM } from 'jsdom' -import { cacherElementsConditionnels } from '../page/conseils' -import { joursAvant } from '../utils' -import Profil from '../profil' +import { cacherElementsConditionnels } from '../../page/conseils' +import { joursAvant } from '../../utils' +import Profil from '../../profil' describe('Conseils personnels', function () { it('Je n’ai pas d’activité pro', function () { diff --git a/src/scripts/tests/test.ics.js b/src/scripts/tests/unit/test.ics.js similarity index 99% rename from src/scripts/tests/test.ics.js rename to src/scripts/tests/unit/test.ics.js index 626de6786..138a3549f 100644 --- a/src/scripts/tests/test.ics.js +++ b/src/scripts/tests/unit/test.ics.js @@ -1,6 +1,6 @@ import { assert } from 'chai' -import ICS from '../ics' +import ICS from '../../ics' describe('ICS', function () { it('On génère un ics sans rrule', function () { diff --git a/src/scripts/tests/test.injection.js b/src/scripts/tests/unit/test.injection.js similarity index 98% rename from src/scripts/tests/test.injection.js rename to src/scripts/tests/unit/test.injection.js index 553f87367..238a86b91 100644 --- a/src/scripts/tests/test.injection.js +++ b/src/scripts/tests/unit/test.injection.js @@ -1,11 +1,11 @@ import { assert } from 'chai' import { JSDOM } from 'jsdom' -import AlgorithmeOrientation from '../algorithme/orientation' +import AlgorithmeOrientation from '../../algorithme/orientation' -import * as injection from '../injection' +import * as injection from '../../injection' -import Profil from '../profil' +import Profil from '../../profil' describe('Injection', function () { describe('Caractéristiques à risques', function () { diff --git a/src/scripts/tests/test.profil.js b/src/scripts/tests/unit/test.profil.js similarity index 99% rename from src/scripts/tests/test.profil.js rename to src/scripts/tests/unit/test.profil.js index ac2500e8e..8fc56c302 100644 --- a/src/scripts/tests/test.profil.js +++ b/src/scripts/tests/unit/test.profil.js @@ -1,7 +1,7 @@ import { assert } from 'chai' -import Profil from '../profil' -import { joursAvant } from '../utils' +import Profil from '../../profil' +import { joursAvant } from '../../utils' describe('Profil', function () { it('Le nom du profil n’est pas échappé', function () { diff --git a/src/scripts/tests/test.questionnaire.js b/src/scripts/tests/unit/test.questionnaire.js similarity index 99% rename from src/scripts/tests/test.questionnaire.js rename to src/scripts/tests/unit/test.questionnaire.js index 88439c935..d168553e0 100644 --- a/src/scripts/tests/test.questionnaire.js +++ b/src/scripts/tests/unit/test.questionnaire.js @@ -1,14 +1,14 @@ import { assert } from 'chai' -import { Questionnaire } from '../questionnaire' +import { Questionnaire } from '../../questionnaire' import { beforeSuiviIntroduction, beforeSuiviSymptomes, beforeSuiviHistorique, -} from '../questionnaire' +} from '../../questionnaire' -import Profil from '../profil' +import Profil from '../../profil' const questionnaire = new Questionnaire() diff --git a/src/scripts/tests/test.router.js b/src/scripts/tests/unit/test.router.js similarity index 96% rename from src/scripts/tests/test.router.js rename to src/scripts/tests/unit/test.router.js index 376a72f07..f9d7f79fd 100644 --- a/src/scripts/tests/test.router.js +++ b/src/scripts/tests/unit/test.router.js @@ -1,8 +1,8 @@ import { assert } from 'chai' -import { Router } from '../router' -import Profil from '../profil' -import { Questionnaire } from '../questionnaire' +import { Router } from '../../router' +import Profil from '../../profil' +import { Questionnaire } from '../../questionnaire' class FakeApp { // Juste ce qu’il faut pour ces tests diff --git a/src/scripts/tests/test.situation.js b/src/scripts/tests/unit/test.situation.js similarity index 99% rename from src/scripts/tests/test.situation.js rename to src/scripts/tests/unit/test.situation.js index 726f8c26d..3b72d1ed4 100644 --- a/src/scripts/tests/test.situation.js +++ b/src/scripts/tests/unit/test.situation.js @@ -3,8 +3,8 @@ import { itParam } from 'mocha-param' import { createProfil } from './helpers' -import AlgorithmeOrientation from '../algorithme/orientation' -import { joursAvant } from '../utils' +import AlgorithmeOrientation from '../../algorithme/orientation' +import { joursAvant } from '../../utils' // On parcourt tous les cas possibles par colonnes. const matrice = [ diff --git a/src/scripts/tests/test.updater.js b/src/scripts/tests/unit/test.updater.js similarity index 94% rename from src/scripts/tests/test.updater.js rename to src/scripts/tests/unit/test.updater.js index c54b8a9d6..08f3e6f29 100644 --- a/src/scripts/tests/test.updater.js +++ b/src/scripts/tests/unit/test.updater.js @@ -1,6 +1,6 @@ import { assert } from 'chai' -import Updater from '../updater' +import Updater from '../../updater' describe('Updater', function () { it('La page d’introduction n’est pas interactive', function () {