Skip to content
Snippets Groups Projects

Feat/insee code

Merged Hugo SUBTIL requested to merge feat/insee-code into main
Files
12
+ 22
0
const { getInseeCode } = require('../../src/requests/insee')
describe('getInseeCode', () => {
it('should return a valid insee code for Lyon 7', async () => {
expect(await getInseeCode(69007)).toEqual('69387')
})
it('should return null for a unexisting post code', async () => {
expect(await getInseeCode(69069)).toEqual(null)
})
it('should return null for post code 69290 when city is not provided', async () => {
expect(await getInseeCode(69290)).toEqual(null)
})
it('should return Craponne insee code for post code 69290', async () => {
expect(await getInseeCode(69290, 'CRAPONNE')).toEqual('69069')
})
it('should return Pollionnay insee code for post code 69290', async () => {
expect(await getInseeCode(69290, 'POLLIONNAY')).toEqual('69154')
})
})
Loading