This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.test.js
72 lines (66 loc) · 1.56 KB
/
index.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import { parse } from './index.js';
describe('numeroSecuriteSociale', () => {
'use strict';
describe('# parse', () => {
it('186069305102313', () => {
expect(parse(186069305102313)).toEqual({
gender: 'M',
foreigner: false,
yearBirth: '86',
monthBirth: '06',
departement: '93',
town: '051',
birthOrder: '023',
key: '13',
});
});
it('286129147102722', () => {
expect(parse(286129147102722)).toEqual({
gender: 'F',
foreigner: false,
yearBirth: '86',
monthBirth: '12',
departement: '91',
town: '471',
birthOrder: '027',
key: '22',
});
});
it('269054958815780', () => {
expect(parse(269054958815780)).toEqual({
gender: 'F',
foreigner: false,
yearBirth: '69',
monthBirth: '05',
departement: '49',
town: '588',
birthOrder: '157',
key: '80',
});
});
it('369059758815780', () => {
expect(parse(369059758815780)).toEqual({
gender: 'M',
foreigner: true,
yearBirth: '69',
monthBirth: '05',
departement: '975',
town: '88',
birthOrder: '157',
key: '80',
});
});
it('494019717426301', () => {
expect(parse('494019717426301')).toEqual({
gender: 'F',
foreigner: true,
yearBirth: '94',
monthBirth: '01',
departement: '971',
town: '74',
birthOrder: '263',
key: '01',
});
});
});
});