mikaello / norwegian-national-id-validator

Validate Norwegian national identity numbers
https://mikaello.github.io/norwegian-national-id-validator
MIT License
24 stars 7 forks source link

Make age tests general #3

Closed mikaello closed 5 years ago

mikaello commented 7 years ago

When testing the age function it is hardcoded what the result will be, e.g. possibleAgesOfPersonWithIdNumber('04119850938').should.deepEqual([118]), this will only work until 03.11.2016, after that the test will fail, since the person will turn 119.

fatso83 commented 5 years ago

You can use lolex for this to fake time. No issues then - just fake the clock to be a constant (like March 1 2016)