danish-mock-cpr
v1.1.4
Published
Create danish CPR to be used in a mocked test environmnet
Downloads
2
Maintainers
Readme
danish-mock-cpr
automationpi :)
You may need to test with random Danish CPR numbers in your automation test scenarios. This package helps by generating CPR numbers for test.
Getting started
npm install danish-mock-cpr
Example.
const cpr = require('danish-mock-cpr');
console.log(cpr.generateCPR()) // default
console.log(cpr.generateCPR(2012)) // Generate a CPR for a person born between 2012 and today
console.log(cpr.generateCPR(1980,2000)) // Generate a CPR for a person born between 1980 and 2000
console.log(cpr.generateCPR('','','male')) // Gender male
console.log(cpr.generateCPR('','','Female')) // Gender female
console.log(cpr.generateCPR('1980', '1990', 'Female')) // born between a start date and end date, gender female
console.log(cpr.generateCPR('2001','2015','Male')) // born between a start date and end date, gender male
#Ouput
>node app.js
{ cpr: '0303117289' }
{ cpr: '2112155744' }
{ cpr: '1507967828' }
{ cpr: '0101009143' }
{ cpr: '0101006446' }
#reusenotreinvent