You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
395 B
15 lines
395 B
import test from 'ava'
|
|
import Chance from '../chance.js'
|
|
import _ from 'lodash'
|
|
|
|
const chance = new Chance()
|
|
|
|
test('cnpj() returns a random valid taxpayer number for Brazil companies (CNPJ)', t => {
|
|
_.times(1000, () => {
|
|
let cnpj = chance.cnpj()
|
|
t.true(_.isString(cnpj))
|
|
t.true(/^\d{2}.\d{3}.\d{3}\/\d{4}-\d{2}$/m.test(cnpj))
|
|
t.is(cnpj.length, 18)
|
|
})
|
|
})
|
|
|
|
|