• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

inclusion-numerique / coop-mediation-numerique / 134f1cc8-b272-471e-be1c-25fe3b4baafa

17 Mar 2026 04:15PM UTC coverage: 6.94% (-3.9%) from 10.79%
134f1cc8-b272-471e-be1c-25fe3b4baafa

push

circleci

web-flow
Merge pull request #437 from inclusion-numerique/dev

release

470 of 10426 branches covered (4.51%)

Branch coverage included in aggregate %.

28 of 584 new or added lines in 86 files covered. (4.79%)

1348 existing lines in 161 files now uncovered.

1355 of 15871 relevant lines covered (8.54%)

37.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/apps/web/src/utils/getDepartementFromCodeInsee.ts
1
import {
2
  Departement,
3
  departementsByCode,
4
} from '@app/web/data/collectivites-territoriales/departements'
5

UNCOV
6
export const getDepartementCodeFromCodeInsee = (codeInsee: string): string =>
×
UNCOV
7
  codeInsee.startsWith('97') ? codeInsee.slice(0, 3) : codeInsee.slice(0, 2)
×
8

UNCOV
9
export const getDepartementFromCode = (
×
10
  codeDepartement: string,
11
): Departement => {
UNCOV
12
  const departement = departementsByCode.get(codeDepartement)
×
13

UNCOV
14
  if (!departement)
×
15
    throw new Error(`No departement found for code "${codeDepartement}"`)
×
16

UNCOV
17
  return departement
×
18
}
19

UNCOV
20
export const getDepartementFromCodeInsee = (codeInsee: string): Departement =>
×
UNCOV
21
  getDepartementFromCode(getDepartementCodeFromCodeInsee(codeInsee))
×
22

UNCOV
23
export const getDepartementsFromCodesInsee = (
×
24
  codesInsee: string[],
25
): Departement[] => {
UNCOV
26
  const codes = new Set(codesInsee.map(getDepartementCodeFromCodeInsee))
×
27

UNCOV
28
  return [...codes.values()].map(getDepartementFromCode)
×
29
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc