blob: ab88a5fce6185761c2de2850d49f3118eb52c819 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
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)
})
})
|