diff --git a/README.md b/README.md index d029263f..d5e11489 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ hu-HU | Hungarian | `Fakerator("hu-HU");` | [Icebob](https://git it-IT | Italian | `Fakerator("it-IT");` | [faker.js](https://github.com/Marak/faker.js) nb-NO | Norwegian | `Fakerator("nb-NO");` | [faker.js](https://github.com/Marak/faker.js) pl-PL | Polish | `Fakerator("pl-PL");` | [faker.js](https://github.com/Marak/faker.js) +pt-BR | Brazilian Portuguese | `Fakerator("pt-BR");` | [Filipe Forattini](https://github.com/filipeforattini) ru-RU | Russian | `Fakerator("ru-RU");` | [faker.js](https://github.com/Marak/faker.js) sk-SK | Slovakian | `Fakerator("sk-SK");` | [faker.js](https://github.com/Marak/faker.js) sv-SE | Swedish | `Fakerator("sv-SE");` | [faker.js](https://github.com/Marak/faker.js) @@ -411,6 +412,6 @@ fakerator is available under the [MIT license](https://tldrlegal.com/license/mit ## Contact -Copyright (C) 2016 Icebob +Copyright (C) 2021 Icebob [![@icebob](https://img.shields.io/badge/github-icebob-green.svg)](https://github.com/icebob) [![@icebob](https://img.shields.io/badge/twitter-Icebobcsi-blue.svg)](https://twitter.com/Icebobcsi) diff --git a/lib/locales/pt-BR/address/countryWithCodes.js b/lib/locales/pt-BR/address/countryWithCodes.js new file mode 100644 index 00000000..54fc3551 --- /dev/null +++ b/lib/locales/pt-BR/address/countryWithCodes.js @@ -0,0 +1,253 @@ +/* Datasource: https://github.com/umpirsky/country-list */ + +module.exports = { + "AF ": "Afeganistão", + "ZA": "África do Sul", + "AL": "Albânia", + "DE": "Alemanha", + "AD": "Andorra", + "AO": "Angola", + "AI": "Anguila", + "AQ": "Antártida", + "AG": "Antígua e Barbuda", + "SA": "Arábia Saudita", + "DZ": "Argélia", + "AR": "Argentina", + "AM": "Armênia", + "AW": "Aruba", + "AU": "Austrália", + "AT": "Áustria", + "AZ": "Azerbaijão", + "BS": "Bahamas", + "BH": "Bahrein", + "BD": "Bangladesh", + "BB": "Barbados", + "BE": "Bélgica", + "BZ": "Belize", + "BJ": "Benin", + "BM": "Bermudas", + "BY": "Bielorrússia", + "BO": "Bolívia", + "BA": "Bósnia e Herzegovina", + "BW": "Botsuana", + "BR": "Brasil", + "BN": "Brunei", + "BG": "Bulgária", + "BF": "Burquina Faso", + "BI": "Burundi", + "BT": "Butão", + "CV": "Cabo Verde", + "CM": "Camarões", + "KH": "Camboja", + "CA": "Canadá", + "QA": "Catar", + "KZ": "Cazaquistão", + "TD": "Chade", + "CL": "Chile", + "CN": "China", + "CY": "Chipre", + "VA": "Cidade do Vaticano", + "CO": "Colômbia", + "KM": "Comores", + "CD": "Congo - Kinshasa", + "KP": "Coreia do Norte", + "KR": "Coreia do Sul", + "CI": "Costa do Marfim", + "CR": "Costa Rica", + "HR": "Croácia", + "CU": "Cuba", + "CW": "Curaçao", + "DK": "Dinamarca", + "DJ": "Djibuti", + "DM": "Dominica", + "EG": "Egito", + "SV": "El Salvador", + "AE": "Emirados Árabes Unidos", + "EC": "Equador", + "ER": "Eritreia", + "SK": "Eslováquia", + "SI": "Eslovênia", + "ES": "Espanha", + "SZ": "Essuatíni", + "US": "Estados Unidos", + "EE": "Estônia", + "ET": "Etiópia", + "FJ": "Fiji", + "PH": "Filipinas", + "FI": "Finlândia", + "FR": "França", + "GA": "Gabão", + "GM": "Gâmbia", + "GH": "Gana", + "GE": "Geórgia", + "GI": "Gibraltar", + "GD": "Granada", + "GR": "Grécia", + "GL": "Groenlândia", + "GP": "Guadalupe", + "GU": "Guam", + "GT": "Guatemala", + "GG": "Guernsey", + "GY": "Guiana", + "GF": "Guiana Francesa", + "GN": "Guiné", + "GQ": "Guiné Equatorial", + "GW": "Guiné-Bissau", + "HT": "Haiti", + "HN": "Honduras", + "HK": "Hong Kong, RAE da China", + "HU": "Hungria", + "YE": "Iêmen", + "BV": "Ilha Bouvet", + "CX": "Ilha Christmas", + "IM": "Ilha de Man", + "NF": "Ilha Norfolk", + "AX": "Ilhas Aland", + "KY": "Ilhas Cayman", + "CC": "Ilhas Cocos: Keeling)", + "CK": "Ilhas Cook", + "FO": "Ilhas Faroe", + "GS": "Ilhas Geórgia do Sul e Sandwich do Sul", + "HM": "Ilhas Heard e McDonald", + "FK": "Ilhas Malvinas", + "MP": "Ilhas Marianas do Norte", + "MH": "Ilhas Marshall", + "UM": "Ilhas Menores Distantes dos EUA", + "PN": "Ilhas Pitcairn", + "SB": "Ilhas Salomão", + "TC": "Ilhas Turcas e Caicos", + "VI": "Ilhas Virgens Americanas", + "VG": "Ilhas Virgens Britânicas", + "IN": "Índia", + "ID": "Indonésia", + "IR": "Irã", + "IQ": "Iraque", + "IE": "Irlanda", + "IS": "Islândia", + "IL": "Israel", + "IT": "Itália", + "JM": "Jamaica", + "JP": "Japão", + "JE": "Jersey", + "JO": "Jordânia", + "KW": "Kuwait", + "LA": "Laos", + "LS": "Lesoto", + "LV": "Letônia", + "LB": "Líbano", + "LR": "Libéria", + "LY": "Líbia", + "LI": "Liechtenstein", + "LT": "Lituânia", + "LU": "Luxemburgo", + "MO": "Macau, RAE da China", + "MK": "Macedônia do Norte", + "MG": "Madagascar", + "MY": "Malásia", + "MW": "Malaui", + "MV": "Maldivas", + "ML": "Mali", + "MT": "Malta", + "MA": "Marrocos", + "MQ": "Martinica", + "MU": "Maurício", + "MR": "Mauritânia", + "YT": "Mayotte", + "MX": "México", + "MM": "Mianmar: Birmânia)", + "FM": "Micronésia", + "MZ": "Moçambique", + "MD": "Moldova", + "MC": "Mônaco", + "MN": "Mongólia", + "ME": "Montenegro", + "MS": "Montserrat", + "NA": "Namíbia", + "NR": "Nauru", + "NP": "Nepal", + "NI": "Nicarágua", + "NE": "Níger", + "NG": "Nigéria", + "NU": "Niue", + "NO": "Noruega", + "NC": "Nova Caledônia", + "NZ": "Nova Zelândia", + "OM": "Omã", + "NL": "Países Baixos", + "BQ": "Países Baixos Caribenhos", + "PW": "Palau", + "PA": "Panamá", + "PG": "Papua-Nova Guiné", + "PK": "Paquistão", + "PY": "Paraguai", + "PE": "Peru", + "PF": "Polinésia Francesa", + "PL": "Polônia", + "PR": "Porto Rico", + "PT": "Portugal", + "KE": "Quênia", + "KG": "Quirguistão", + "KI": "Quiribati", + "GB": "Reino Unido", + "CF": "República Centro-Africana", + "CG": "República do Congo", + "DO": "República Dominicana", + "RE": "Reunião", + "RO": "Romênia", + "RW": "Ruanda", + "RU": "Rússia", + "EH": "Saara Ocidental", + "WS": "Samoa", + "AS": "Samoa Americana", + "SM": "San Marino", + "SH": "Santa Helena", + "LC": "Santa Lúcia", + "BL": "São Bartolomeu", + "KN": "São Cristóvão e Névis", + "MF": "São Martinho", + "PM": "São Pedro e Miquelão", + "ST": "São Tomé e Príncipe", + "VC": "São Vicente e Granadinas", + "SC": "Seicheles", + "SN": "Senegal", + "SL": "Serra Leoa", + "RS": "Sérvia", + "SG": "Singapura", + "SX": "Sint Maarten", + "SY": "Síria", + "SO": "Somália", + "LK": "Sri Lanka", + "SD": "Sudão", + "SS": "Sudão do Sul", + "SE": "Suécia", + "CH": "Suíça", + "SR": "Suriname", + "SJ": "Svalbard e Jan Mayen", + "TJ": "Tadjiquistão", + "TH": "Tailândia", + "TW": "Taiwan", + "TZ": "Tanzânia", + "CZ": "Tchéquia", + "IO": "Território Britânico do Oceano Índico", + "TF": "Territórios Franceses do Sul", + "PS": "Territórios palestinos", + "TL": "Timor-Leste", + "TG": "Togo", + "TK": "Tokelau", + "TO": "Tonga", + "TT": "Trinidad e Tobago", + "TN": "Tunísia", + "TM": "Turcomenistão", + "TR": "Turquia", + "TV": "Tuvalu", + "UA": "Ucrânia", + "UG": "Uganda", + "UY": "Uruguai", + "UZ": "Uzbequistão", + "VU": "Vanuatu", + "VE": "Venezuela", + "VN": "Vietnã", + "WF": "Wallis e Futuna", + "ZM": "Zâmbia", + "ZW": "Zimbábue", +}; \ No newline at end of file diff --git a/lib/locales/pt-BR/address/index.js b/lib/locales/pt-BR/address/index.js new file mode 100644 index 00000000..cd1b4150 --- /dev/null +++ b/lib/locales/pt-BR/address/index.js @@ -0,0 +1,102 @@ +import countries from "./countryWithCodes"; + +module.exports = { + countryAndCode() { + let country = this.random.objectElement(countries); + return { + code: Object.keys(country)[0], + name: country[Object.keys(country)[0]] + }; + }, + + geoLocation() { + return { + latitude: (this.random.number(180 * 10000) / 10000.0 - 90.0), + longitude: (this.random.number(360 * 10000) / 10000.0 - 180.0) + }; + }, + + state: [ + "Acre", + "Alagoas", + "Amazonas", + "Amapá", + "Bahia", + "Ceará", + "Distrito Federal", + "Espírito Santo", + "Goiás", + "Maranhão", + "Minas Gerais", + "Mato Grosso do Sul", + "Mato Grosso", + "Pará", + "Paraíba", + "Pernambuco", + "Piauí", + "Paraná", + "Rio de Janeiro", + "Rio Grande do Norte", + "Rondônia", + "Roraima", + "Rio Grande do Sul", + "Santa Catarina", + "Sergipe", + "São Paulo", + "Tocantins", + ], + + stateAbbr: [ + "AC", + "AL", + "AM", + "AP", + "BA", + "CE", + "DF", + "ES", + "GO", + "MA", + "MG", + "MS", + "MT", + "PA", + "PB", + "PE", + "PI", + "PR", + "RJ", + "RN", + "RO", + "RR", + "RS", + "SC", + "SE", + "SP", + "TO", + ], + + postCode: [ + "#####-###" + ], + + street: [ + "#{address.streetName} #{address.buildingNumber}", + "#{address.streetName} #{address.buildingNumber}", + "#{address.streetName} #{address.buildingNumber} Apto ###", + "#{address.streetName} #{address.buildingNumber} Casa ###" + ], + + streetName: [ + "#{address.streetSuffix} #{names.firstName}", + "#{address.streetSuffix} #{names.lastName}" + ], + + streetSuffix: [ + "Alameda", + "Avenida", + "Praça", + "Rodovia", + "Rua", + ], +}; diff --git a/lib/locales/pt-BR/build.js b/lib/locales/pt-BR/build.js new file mode 100644 index 00000000..0a3c1038 --- /dev/null +++ b/lib/locales/pt-BR/build.js @@ -0,0 +1,24 @@ +import isNil from "lodash/isNil"; +import isArray from "lodash/isArray"; +import isFunction from "lodash/isFunction"; +import isObject from "lodash/isObject"; +import mergeWith from "lodash/mergeWith"; + +import Fakerator from "lib/fakerator"; + +module.exports = function() { + let locale = require("lib/locales/pt-BR"); + let fbLocale = require("lib/locales/default"); + + // Merge locale and fallback + locale = mergeWith(locale, fbLocale, (objValue) => { + // DON'T MERGE ARRAYS + if (isArray(objValue) || isFunction(objValue)) + return objValue; + + if (!isNil(objValue) && !isObject(objValue)) + return objValue; + }); + + return new Fakerator(locale); +}; \ No newline at end of file diff --git a/lib/locales/pt-BR/company/index.js b/lib/locales/pt-BR/company/index.js new file mode 100644 index 00000000..8bc1889d --- /dev/null +++ b/lib/locales/pt-BR/company/index.js @@ -0,0 +1,20 @@ +module.exports = { + name: [ + "#{company.preffix} #{names.lastName}", + "#{names.lastName} #{company.suffix}", + "#{names.lastName}-#{names.lastName} #{company.suffix}", + "#{names.lastName}, #{names.lastName} and #{names.lastName} #{company.suffix}" + ], + + suffix: [ + "", + "Ltda", + "ME", + ], + + preffix: [ + "", + "Grupo", + "Associacao", + ], +}; \ No newline at end of file diff --git a/lib/locales/pt-BR/date/index.js b/lib/locales/pt-BR/date/index.js new file mode 100644 index 00000000..3ecfcca4 --- /dev/null +++ b/lib/locales/pt-BR/date/index.js @@ -0,0 +1,46 @@ +module.exports = { + month: [ + "Janeiro", + "Fevereiro", + "Março", + "Abril", + "Maio", + "Junho", + "Julho", + "Agosto", + "Setembro", + "Outubro", + "Novembro", + "Dezembro" + ], + + weekday: [ + "Domingo", + "Segunda", + "Terça", + "Quarta", + "Quinta", + "Sexta", + "Sábado" + ], + + weekdayShort: [ + "Dom", + "Seg", + "Ter", + "Qua", + "Qui", + "Sex", + "Sáb" + ], + + weekdayMin: [ + "Do", + "Se", + "Te", + "Qa", + "Qi", + "Se", + "Sa" + ], +}; \ No newline at end of file diff --git a/lib/locales/pt-BR/index.js b/lib/locales/pt-BR/index.js new file mode 100644 index 00000000..4279fb8f --- /dev/null +++ b/lib/locales/pt-BR/index.js @@ -0,0 +1,15 @@ +module.exports = { + _meta: { + id: "pt-BR", + fallback: null, + language: "Portugues (Brazil)", + country: "Brazil", + countryCode: "BR" + }, + + address: require("./address"), + company: require("./company"), + internet: require("./internet"), + names: require("./names"), + phone: require("./phone"), +}; \ No newline at end of file diff --git a/lib/locales/pt-BR/internet/index.js b/lib/locales/pt-BR/internet/index.js new file mode 100644 index 00000000..0784a2ac --- /dev/null +++ b/lib/locales/pt-BR/internet/index.js @@ -0,0 +1,25 @@ +module.exports = { + tld: [ + "br", + "net", + "com", + "com.br", + "com.br", + "com.br", + ], + + imageCategories: [ + "animais", + "comércio", + "cidades", + "comida", + "esportes", + "gatos", + "lazer", + "natureza", + "pessoas", + "transporte", + "vestuário", + "viagem", + ], +}; \ No newline at end of file diff --git a/lib/locales/pt-BR/names/firstNameFemale.js b/lib/locales/pt-BR/names/firstNameFemale.js new file mode 100644 index 00000000..7d519692 --- /dev/null +++ b/lib/locales/pt-BR/names/firstNameFemale.js @@ -0,0 +1,94 @@ +module.exports = [ + "Abril", + "Adriana", + "Agustina", + "Alessandra", + "Alexa", + "Allison", + "Alma", + "Amanda", + "Amélia", + "Ana", + "Andrea", + "Antonieta", + "Ariadna", + "Ariana", + "Ashley", + "Beatriz", + "Bianca", + "Camila", + "Carla", + "Carolina", + "Catarina", + "Clara", + "Daniela", + "Elizabeth", + "Emília", + "Fabiana", + "Fátima", + "Gabriela", + "Giovana", + "Helena", + "Irene", + "Isabel", + "Isabella", + "Isadora", + "Ivana", + "Jasmin", + "Joana", + "Josefina", + "Juliana", + "Julieta", + "Júlia", + "Ketlin", + "Laura", + "Luana", + "Luara", + "Luciana", + "Luna", + "Luzia", + "Madalena", + "Maitê", + "Malena", + "Manuela", + "Mariana", + "Mel", + "Melissa", + "Mia", + "Micaela", + "Michele", + "Miranda", + "Natália", + "Nicole", + "Noelí", + "Norma", + "Nádia", + "Olívia", + "Ornela", + "Paula", + "Paulina", + "Pâmela", + "Rafaela", + "Rebeca", + "Regina", + "Renata", + "Sabrina", + "Salomé", + "Samanta", + "Sara", + "Silvana", + "Sofia", + "Sophie", + "Suzana", + "Taís", + "Tábata", + "Valentina", + "Valéria", + "Violeta", + "Vitória", + "Abgail", + "Constância", + "Hortência", + "Tessália", + "Thalissa", +]; diff --git a/lib/locales/pt-BR/names/firstNameMale.js b/lib/locales/pt-BR/names/firstNameMale.js new file mode 100644 index 00000000..9c7cd57b --- /dev/null +++ b/lib/locales/pt-BR/names/firstNameMale.js @@ -0,0 +1,91 @@ +module.exports = [ + "Aaron", + "Adriano", + "Alan", + "Alexandre", + "Alonso", + "Anderson", + "Andres", + "Antônio", + "Benjamin", + "Bruno", + "Camilo", + "Carlos", + "Christian", + "Christopher", + "Cristóvão", + "Daniel", + "Dante", + "David", + "Diego", + "Eduardo", + "Elias", + "Emanuel", + "Emiliano", + "Emílio", + "Estêvão", + "Evandro", + "Everton", + "Felipe", + "Fernando", + "Francisco", + "Franco", + "Fábio", + "Gabriel", + "Gian", + "Guilherme", + "Gustavo", + "Henrique", + "Hernani", + "Horácio", + "Hugo", + "Ian", + "Inácio", + "Isaac", + "Ivan", + "Jerônimo", + "Joaquin", + "Jorge", + "Josué", + "José", + "João", + "Kevin", + "Leandro", + "Leonardo", + "Lucas", + "Luciano", + "Luis", + "Manuel", + "Mateus", + "Matias", + "Miguel", + "Mário", + "Máximo", + "Noel", + "Pablo", + "Paulo", + "Pedro", + "Rafael", + "Ricardo", + "Rodrigo", + "Samuel", + "Santiago", + "Simon", + "Sérgio", + "Thales", + "Thiago", + "Tomás", + "Valentin", + "Vicente", + "Agostinho", + "Demian", + "Giovane", + "Jácomo", + "Martinho", + "Maximiano", + "Natal", + "Sebastião", + "Simão", + "Teobaldo", + "Ziraldo", +]; diff --git a/lib/locales/pt-BR/names/index.js b/lib/locales/pt-BR/names/index.js new file mode 100644 index 00000000..00433a16 --- /dev/null +++ b/lib/locales/pt-BR/names/index.js @@ -0,0 +1,21 @@ +module.exports = { + firstNameM: require("./firstNameMale"), + firstNameF: require("./firstNameFemale"), + lastNameM: require("./lastName"), + lastNameF: require("./lastName"), + + prefix: [], + suffix: [], + + nameM: [ + "#{names.firstNameM} #{names.lastName}", + "#{names.firstNameM} #{names.lastName}", + "#{names.firstNameM} #{names.lastName} #{names.firstNameM}", + ], + + nameF: [ + "#{names.firstNameF} #{names.lastName}", + "#{names.firstNameF} #{names.lastName}", + "#{names.firstNameF} #{names.lastName} #{names.firstNameF}", + ] +}; diff --git a/lib/locales/pt-BR/names/lastName.js b/lib/locales/pt-BR/names/lastName.js new file mode 100644 index 00000000..13ed7cd8 --- /dev/null +++ b/lib/locales/pt-BR/names/lastName.js @@ -0,0 +1,174 @@ +module.exports = [ + "Abreu", + "Azevedo", + "Aguiar", + "Aragão", + "Assunção", + "Aranda", + "Ávila", + "Balestero", + "Barreto", + "Barros", + "Batista", + "Bezerra", + "Beltrão", + "Benites", + "Bittencourt", + "Branco", + "Bonilha", + "Brito", + "Burgos", + "Caldeira", + "Camacho", + "Campos", + "Carmona", + "Carrara", + "Casanova", + "Chaves", + "Cervantes", + "Colaço", + "Cordeiro", + "Corona", + "Correia", + "Cortês", + "Cruz", + "D\"ávila", + "Delatorre", + "Delgado", + "Delvalle", + "Dias", + "Domingues", + "Dominato", + "Duarte", + "Escobar", + "Espinoza", + "Esteves", + "Estrada", + "Faria", + "Faro", + "Feliciano", + "Ferminiano", + "Fernandes", + "Ferraz", + "Ferreira", + "Fidalgo", + "Furtado", + "Ferreira", + "Flores", + "Fonseca", + "Franco", + "Fontes", + "Galindo", + "Galhardo", + "Galvão", + "Garcia", + "Gil", + "Godói", + "Gomes", + "Gonçalves", + "Grego", + "Guerra", + "Gusmão", + "Jimenes", + "Leal", + "Leon", + "Lira", + "Lovato", + "Lozano", + "Lutero", + "Madeira", + "Maldonado", + "Marés", + "Marin", + "Marinho", + "Marques", + "Martines", + "Mascarenhas", + "Matias", + "Matos", + "Maia", + "Medina", + "Meireles", + "Mendes", + "Mendonça", + "Molina", + "Montenegro", + "Neves", + "Oliveira", + "Ortega", + "Ortiz", + "Quintana", + "Queirós", + "Pacheco", + "Padilha", + "Padrão", + "Paes", + "Paz", + "Pedrosa", + "Pena", + "Pereira", + "Perez", + "Prado", + "Pontes", + "Quintana", + "Queirós", + "Ramires", + "Ramos", + "Rangel", + "Rezende", + "Reis", + "Rico", + "Rios", + "Rivera", + "Rocha", + "Rodrigues", + "Romero", + "Roque", + "Rosa", + "Salas", + "Salazar", + "Sales", + "Salgado", + "Sanches", + "Sandoval", + "Santacruz", + "Santana", + "Santiago", + "Saraiva", + "Sepúlveda", + "Serna", + "Serra", + "Serrano", + "Soares", + "Solano", + "Soto", + "Tamoio", + "Teles", + "Toledo", + "Torres", + "Uchoa", + "Urias", + "Valdez", + "Valência", + "Valentin", + "Vale", + "Vasques", + "Vega", + "Velasques", + "Verdugo", + "Verdara", + "Vieira", + "Vila", + "Zamana", + "Zambrano", + "Zaragoça", + "da Cruz", + "da Rosa", + "da Silva", + "das Dores", + "das Neves", + "de Aguiar", + "de Oliveira", + "de Souza", + "dos Santos", +]; diff --git a/lib/locales/pt-BR/phone/index.js b/lib/locales/pt-BR/phone/index.js new file mode 100644 index 00000000..38b5afea --- /dev/null +++ b/lib/locales/pt-BR/phone/index.js @@ -0,0 +1,18 @@ +module.exports = { + number: [ + "+55 ## 2#######", + "+55 ## 3#######", + "+55 ## 4#######", + "+55 ## 9########", + + "(##) 2### ####", + "(##) 2###-####", + "(##) 3### ####", + "(##) 3###-####", + "(##) 4### ####", + "(##) 4###-####", + + "(##) 9#### ####", + "(##) 9####-####", + ] +}; diff --git a/package-lock.json b/package-lock.json index 920410e9..a8d3b0fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1956,7 +1956,8 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } @@ -10200,7 +10201,8 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } @@ -10743,7 +10745,8 @@ }, "minimist": { "version": "1.2.0", - "resolved": "", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } } diff --git a/test/specs/locales/pt-BR/index.spec.js b/test/specs/locales/pt-BR/index.spec.js new file mode 100644 index 00000000..3b33498e --- /dev/null +++ b/test/specs/locales/pt-BR/index.spec.js @@ -0,0 +1,85 @@ +import { expect } from "chai"; + +import Fakerator from "lib"; + +describe("Locale pt-BR", () => { + + let fakerator; + + beforeEach( () => { + fakerator = new Fakerator("pt-BR"); + fakerator.seed(5511); + }); + + it("check locale definitions", () => { + expect(fakerator.locale.names).to.be.an("Object"); + expect(fakerator.locale.names.firstNameM).to.be.length(89); + + expect(fakerator.locale.phone).to.be.an("Object"); + expect(fakerator.locale.address).to.be.an("Object"); + expect(fakerator.locale.company).to.be.an("Object"); + expect(fakerator.locale.internet).to.be.an("Object"); + }); + + it("check names definitions", () => { + expect(fakerator.names.firstName()).to.be.equal("Manuel"); + expect(fakerator.names.lastName()).to.be.equal("Toledo"); + expect(fakerator.names.name()).to.be.equal("Carla Reis"); + }); + + it("check company definitions", () => { + expect(fakerator.company.name()).to.be.equal("Grupo Toledo"); + }); + + it("check phone definitions", () => { + expect(fakerator.phone.number()).to.be.equal("+55 64 38552065"); + }); + + it("check address definitions", () => { + expect(fakerator.address.city()).to.be.equal("New Tomásmouth"); + expect(fakerator.address.street()).to.be.equal("Alameda Maitê 1696 Apto 440"); + expect(fakerator.address.streetName()).to.be.equal("Alameda Laura"); + expect(fakerator.address.buildingNumber()).to.be.equal("026"); + expect(fakerator.address.postCode()).to.be.equal("72001-317"); + expect(fakerator.address.state()).to.be.equal("Piauí"); + expect(fakerator.address.country()).to.be.equal("Armênia"); + }); + + it("check internet definitions", () => { + expect(fakerator.internet.userName()).to.be.equal("manuel_toledo"); + expect(fakerator.internet.domain()).to.be.equal("adrianomolina.info"); + expect(fakerator.internet.emailDomain()).to.be.equal("gmail.com"); + expect(fakerator.internet.email()).to.be.equal("abgail.marin@yahoo.com"); + }); + + it("check entity.user", () => { + let user = fakerator.entity.user(); + expect(user).to.be.an("Object"); + + expect(user).to.have.property("firstName").an("String"); + expect(user).to.have.property("lastName").an("String"); + expect(user).to.have.property("userName").an("String"); + expect(user).to.have.property("password").an("String"); + expect(user).to.have.property("email").an("String"); + expect(user).to.have.property("phone").an("String"); + expect(user).to.have.property("dob").an("Date"); + expect(user).to.have.property("website").an("String"); + expect(user).to.have.property("ip").an("String"); + expect(user).to.have.property("avatar").an("String"); + expect(user).to.have.property("gravatar").an("String"); + expect(user).to.have.property("status").an("Boolean"); + expect(user).to.have.property("address").an("Object"); + + expect(user.address).to.have.property("country").an("String"); + expect(user.address).to.have.property("countryCode").an("String").length(2); + expect(user.address).to.have.property("state").an("String"); + expect(user.address).to.have.property("city").an("String"); + expect(user.address).to.have.property("street").an("String"); + expect(user.address).to.have.property("zip").an("String"); + expect(user.address).to.have.property("geo").an("Object"); + expect(user.address.geo).to.have.property("latitude").an("Number"); + expect(user.address.geo).to.have.property("longitude").an("Number"); + + }); + +}); \ No newline at end of file