Skip to content

Commit

Permalink
chore(test): make tsc happy
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil committed Sep 27, 2024
1 parent 148d34e commit 4f94b36
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion test/epoch-time.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import FakeTimers, { InstalledClock } from "@sinonjs/fake-timers";
import FakeTimers, { type InstalledClock } from "@sinonjs/fake-timers";
import { assert } from "chai";
import epochTime from "../src/services/epoch-time";

Expand Down
2 changes: 1 addition & 1 deletion test/is-expired.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import FakeTimers, { InstalledClock } from "@sinonjs/fake-timers";
import FakeTimers, { type InstalledClock } from "@sinonjs/fake-timers";
import { assert } from "chai";
import { isExpired } from "../src/services/is-expired";

Expand Down
76 changes: 38 additions & 38 deletions test/organization.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
isWasteManagementOrganization,
} from "../src/services/organization";

const association_org_info: Organization = {
const association_org_info = {
siret: "83511518900010",
cached_tranche_effectifs: "00",
cached_tranche_effectifs_unite_legale: "00",
Expand All @@ -19,9 +19,9 @@ const association_org_info: Organization = {
"81.21Z - Nettoyage courant des bâtiments",
cached_categorie_juridique: "9220",
cached_libelle_categorie_juridique: "Association déclarée",
};
} as Organization;

const entreprise_unipersonnelle_org_info: Organization = {
const entreprise_unipersonnelle_org_info = {
siret: "81801912700021",
cached_tranche_effectifs: null,
cached_tranche_effectifs_unite_legale: null,
Expand All @@ -30,11 +30,11 @@ const entreprise_unipersonnelle_org_info: Organization = {
cached_libelle_activite_principale: "62.01Z - Programmation informatique",
cached_categorie_juridique: "1000",
cached_libelle_categorie_juridique: "Entrepreneur individuel",
};
} as Organization;

describe("isEntrepriseUnipersonnelle", () => {
it("should return false for bad call", () => {
assert.equal(isEntrepriseUnipersonnelle({}), false);
assert.equal(isEntrepriseUnipersonnelle({} as Organization), false);
});

it("should return true for unipersonnelle organization", () => {
Expand All @@ -49,7 +49,7 @@ describe("isEntrepriseUnipersonnelle", () => {
});
});

const lamalou_org_info: Organization = {
const lamalou_org_info = {
siret: "21340126800130",
cached_tranche_effectifs: "12",
cached_tranche_effectifs_unite_legale: "21",
Expand All @@ -59,9 +59,9 @@ const lamalou_org_info: Organization = {
"84.11Z - Administration publique générale",
cached_categorie_juridique: "7210",
cached_libelle_categorie_juridique: "Commune et commune nouvelle",
};
} as Organization;

const dinum_org_info: Organization = {
const dinum_org_info = {
siret: "13002526500013",
cached_tranche_effectifs: "22",
cached_tranche_effectifs_unite_legale: "22",
Expand All @@ -71,9 +71,9 @@ const dinum_org_info: Organization = {
"84.11Z - Administration publique générale",
cached_categorie_juridique: "7120",
cached_libelle_categorie_juridique: "Service central d'un ministère",
};
} as Organization;

const onf_org_info: Organization = {
const onf_org_info = {
siret: "66204311604119",
cached_tranche_effectifs: null,
cached_tranche_effectifs_unite_legale: "52",
Expand All @@ -84,9 +84,9 @@ const onf_org_info: Organization = {
cached_categorie_juridique: "4110",
cached_libelle_categorie_juridique:
"Établissement public national à caractère industriel ou commercial doté d'un comptable public",
};
} as Organization;

const whitelisted_org_info: Organization = {
const whitelisted_org_info = {
siret: "32025248901075",
cached_tranche_effectifs: "42",
cached_tranche_effectifs_unite_legale: "51",
Expand All @@ -95,11 +95,11 @@ const whitelisted_org_info: Organization = {
cached_libelle_activite_principale: "64.92Z - Autre distribution de crédit",
cached_categorie_juridique: "5599",
cached_libelle_categorie_juridique: "SA à conseil d'administration (s.a.i.)",
};
} as Organization;

describe("isCommune", () => {
it("should return false for bad call", () => {
assert.equal(isCommune({}), false);
assert.equal(isCommune({} as Organization), false);
});

it("should return true for collectivite territoriale", () => {
Expand All @@ -111,7 +111,7 @@ describe("isCommune", () => {
});
});

const trackdechets_public_org_info: Organization = {
const trackdechets_public_org_info = {
siret: "25680169700010",
cached_tranche_effectifs: "NN",
cached_tranche_effectifs_unite_legale: "NN",
Expand All @@ -122,11 +122,11 @@ const trackdechets_public_org_info: Organization = {
"38.21Z - Traitement et élimination des déchets non dangereux",
cached_categorie_juridique: "7354",
cached_libelle_categorie_juridique: "Syndicat mixte fermé",
};
} as Organization;

describe("isPublicService", () => {
it("should return false for bad call", () => {
assert.equal(isPublicService({}), false);
assert.equal(isPublicService({} as Organization), false);
});

it("should return true for collectivite territoriale", () => {
Expand Down Expand Up @@ -173,7 +173,7 @@ describe("isWasteManagementOrganization", () => {

describe("isEtablissementScolaireDuPremierEtSecondDegre", () => {
it("should return false for unipersonnelle organization", () => {
const indep_org_info: Organization = {
const indep_org_info = {
siret: "90243432300017",
cached_tranche_effectifs: null,
cached_tranche_effectifs_unite_legale: null,
Expand All @@ -183,14 +183,14 @@ describe("isEtablissementScolaireDuPremierEtSecondDegre", () => {
"85.31Z - Enseignement secondaire général",
cached_categorie_juridique: "1000 ",
cached_libelle_categorie_juridique: "Entrepreneur individuel",
};
} as Organization;
assert.equal(
isEtablissementScolaireDuPremierEtSecondDegre(indep_org_info),
false,
);
});
it("should return true for lycee public", () => {
const lycee_public_org_info: Organization = {
const lycee_public_org_info = {
siret: "19500016100016",
cached_libelle: "Lycee general et technologique jean francois millet",
cached_nom_complet: "Lycee general et technologique jean francois millet",
Expand All @@ -199,9 +199,9 @@ describe("isEtablissementScolaireDuPremierEtSecondDegre", () => {
cached_tranche_effectifs_unite_legale: "22",
cached_libelle_tranche_effectif: "100 à 199 salariés, en 2020",
cached_etat_administratif: "A",
cached_est_active: true,
cached_est_active: "true",
cached_statut_diffusion: "O",
cached_est_diffusible: true,
cached_est_diffusible: "true",
cached_adresse: "1 rue bougainville, 50130 Cherbourg-en-cotentin",
cached_code_postal: "50130",
cached_code_officiel_geographique: "50129",
Expand All @@ -211,14 +211,14 @@ describe("isEtablissementScolaireDuPremierEtSecondDegre", () => {
cached_categorie_juridique: "7331",
cached_libelle_categorie_juridique:
"Établissement public local d'enseignement",
};
} as Organization;
assert.equal(
isEtablissementScolaireDuPremierEtSecondDegre(lycee_public_org_info),
true,
);
});
it("should return true for college public", () => {
const college_public_org_info: Organization = {
const college_public_org_info = {
siret: "19120032800018",
cached_libelle: "College albert camus",
cached_nom_complet: "College albert camus",
Expand All @@ -227,9 +227,9 @@ describe("isEtablissementScolaireDuPremierEtSecondDegre", () => {
cached_tranche_effectifs_unite_legale: "21",
cached_libelle_tranche_effectif: "50 à 99 salariés, en 2020",
cached_etat_administratif: "A",
cached_est_active: true,
cached_est_active: "true",
cached_statut_diffusion: "O",
cached_est_diffusible: true,
cached_est_diffusible: "true",
cached_adresse: "114 rue de la vallee du viaur, 12160 Baraqueville",
cached_code_postal: "12160",
cached_code_officiel_geographique: "12056",
Expand All @@ -239,14 +239,14 @@ describe("isEtablissementScolaireDuPremierEtSecondDegre", () => {
cached_categorie_juridique: "7331",
cached_libelle_categorie_juridique:
"Établissement public local d'enseignement",
};
} as Organization;
assert.equal(
isEtablissementScolaireDuPremierEtSecondDegre(college_public_org_info),
true,
);
});
it("should return false for lycee prive", () => {
const lycee_prive_org_info: Organization = {
const lycee_prive_org_info = {
siret: "31458546400014",
cached_libelle: "Ogec maitrise de massabielle",
cached_nom_complet: "Ogec maitrise de massabielle",
Expand All @@ -255,9 +255,9 @@ describe("isEtablissementScolaireDuPremierEtSecondDegre", () => {
cached_tranche_effectifs_unite_legale: "22",
cached_libelle_tranche_effectif: "50 à 99 salariés, en 2020",
cached_etat_administratif: "A",
cached_est_active: true,
cached_est_active: "true",
cached_statut_diffusion: "O",
cached_est_diffusible: true,
cached_est_diffusible: "true",
cached_adresse: "29 faubourg victor hugo, 97110 Pointe-à-pitre",
cached_code_postal: "97110",
cached_code_officiel_geographique: "97120",
Expand All @@ -266,7 +266,7 @@ describe("isEtablissementScolaireDuPremierEtSecondDegre", () => {
"85.31Z - Enseignement secondaire général",
cached_categorie_juridique: "9220",
cached_libelle_categorie_juridique: "Association déclarée",
};
} as Organization;
assert.equal(
isEtablissementScolaireDuPremierEtSecondDegre(lycee_prive_org_info),
false,
Expand All @@ -283,17 +283,17 @@ describe("isEtablissementScolaireDuPremierEtSecondDegre", () => {
cached_tranche_effectifs_unite_legale: "42",
cached_libelle_tranche_effectif: "10 à 19 salariés, en 2020",
cached_etat_administratif: "A",
cached_est_active: true,
cached_est_active: "true",
cached_statut_diffusion: "O",
cached_est_diffusible: true,
cached_est_diffusible: "true",
cached_adresse: "48 rue de la contrescarpe, 59650 Villeneuve d'ascq",
cached_code_postal: "59650",
cached_code_officiel_geographique: "59009",
cached_activite_principale: "85.20Z",
cached_libelle_activite_principale: "85.20Z - Enseignement primaire",
cached_categorie_juridique: "7210",
cached_libelle_categorie_juridique: "Commune et commune nouvelle",
};
} as Organization;
assert.equal(
isEtablissementScolaireDuPremierEtSecondDegre(
ecole_primaire_publique_org_info,
Expand All @@ -302,7 +302,7 @@ describe("isEtablissementScolaireDuPremierEtSecondDegre", () => {
);
});
it("should return false for ecole primaire privee", () => {
const ecole_primaire_privee_org_info: Organization = {
const ecole_primaire_privee_org_info = {
siret: "39945558300027",
cached_libelle:
"Groupe scolaire ste genevieve st joseph (OGEC) - Ecoles primaires ste genevieve st joseph",
Expand All @@ -312,17 +312,17 @@ describe("isEtablissementScolaireDuPremierEtSecondDegre", () => {
cached_tranche_effectifs_unite_legale: "22",
cached_libelle_tranche_effectif: "10 à 19 salariés, en 2020",
cached_etat_administratif: "A",
cached_est_active: true,
cached_est_active: "true",
cached_statut_diffusion: "O",
cached_est_diffusible: true,
cached_est_diffusible: "true",
cached_adresse: "1 rue sarrus, 12000 Rodez",
cached_code_postal: "12000",
cached_code_officiel_geographique: "12202",
cached_activite_principale: "85.20Z",
cached_libelle_activite_principale: "85.20Z - Enseignement primaire",
cached_categorie_juridique: "9220",
cached_libelle_categorie_juridique: "Association déclarée",
};
} as Organization;
assert.equal(
isEtablissementScolaireDuPremierEtSecondDegre(
ecole_primaire_privee_org_info,
Expand Down

0 comments on commit 4f94b36

Please sign in to comment.