@@ -11,7 +11,7 @@ const functionNames: (keyof StringModule)[] = [
1111 'hexadecimal' ,
1212 'random' ,
1313 'alpha' ,
14- 'alphaNumeric ' ,
14+ 'alphanumeric ' ,
1515 'numeric' ,
1616] ;
1717
@@ -212,7 +212,7 @@ describe('string', () => {
212212
213213 describe ( 'alphaNumeric' , ( ) => {
214214 it ( 'should generate single character when no additional argument was provided' , ( ) => {
215- const actual = faker . string . alphaNumeric ( ) ;
215+ const actual = faker . string . alphanumeric ( ) ;
216216
217217 expect ( actual ) . toHaveLength ( 1 ) ;
218218 } ) ;
@@ -222,28 +222,28 @@ describe('string', () => {
222222 [ 'lower' , / ^ [ a - z 0 - 9 ] { 250 } $ / ] ,
223223 [ 'mixed' , / ^ [ a - z A - Z 0 - 9 ] { 250 } $ / ] ,
224224 ] as const ) ( 'should return %s-case' , ( casing , pattern ) => {
225- const actual = faker . string . alphaNumeric ( { count : 250 , casing } ) ;
225+ const actual = faker . string . alphanumeric ( { count : 250 , casing } ) ;
226226 expect ( actual ) . toMatch ( pattern ) ;
227227 } ) ;
228228
229229 it ( 'should generate many random characters' , ( ) => {
230- const actual = faker . string . alphaNumeric ( 5 ) ;
230+ const actual = faker . string . alphanumeric ( 5 ) ;
231231
232232 expect ( actual ) . toHaveLength ( 5 ) ;
233233 } ) ;
234234
235235 it . each ( [ 0 , - 1 , - 100 ] ) (
236236 'should return empty string when length is <= 0' ,
237237 ( length ) => {
238- const actual = faker . string . alphaNumeric ( length ) ;
238+ const actual = faker . string . alphanumeric ( length ) ;
239239
240240 expect ( actual ) . toBe ( '' ) ;
241241 }
242242 ) ;
243243
244244 it ( 'should be able to ban all alphabetic characters' , ( ) => {
245245 const bannedChars = 'abcdefghijklmnopqrstuvwxyz' . split ( '' ) ;
246- const alphaText = faker . string . alphaNumeric ( {
246+ const alphaText = faker . string . alphanumeric ( {
247247 count : 5 ,
248248 bannedChars,
249249 casing : 'lower' ,
@@ -257,7 +257,7 @@ describe('string', () => {
257257
258258 it ( 'should be able to ban all alphabetic characters via string' , ( ) => {
259259 const bannedChars = 'abcdefghijklmnopqrstuvwxyz' ;
260- const alphaText = faker . string . alphaNumeric ( {
260+ const alphaText = faker . string . alphanumeric ( {
261261 count : 5 ,
262262 bannedChars,
263263 casing : 'lower' ,
@@ -271,7 +271,7 @@ describe('string', () => {
271271
272272 it ( 'should be able to ban all numeric characters' , ( ) => {
273273 const bannedChars = '0123456789' . split ( '' ) ;
274- const alphaText = faker . string . alphaNumeric ( {
274+ const alphaText = faker . string . alphanumeric ( {
275275 count : 5 ,
276276 bannedChars,
277277 } ) ;
@@ -284,7 +284,7 @@ describe('string', () => {
284284
285285 it ( 'should be able to ban all numeric characters via string' , ( ) => {
286286 const bannedChars = '0123456789' ;
287- const alphaText = faker . string . alphaNumeric ( {
287+ const alphaText = faker . string . alphanumeric ( {
288288 count : 5 ,
289289 bannedChars,
290290 } ) ;
@@ -296,7 +296,7 @@ describe('string', () => {
296296 } ) ;
297297
298298 it ( 'should be able to handle mistake in banned characters array' , ( ) => {
299- const alphaText = faker . string . alphaNumeric ( {
299+ const alphaText = faker . string . alphanumeric ( {
300300 count : 5 ,
301301 bannedChars : [ 'a' , 'p' , 'a' ] ,
302302 casing : 'lower' ,
@@ -309,7 +309,7 @@ describe('string', () => {
309309 it ( 'should throw if all possible characters being banned' , ( ) => {
310310 const bannedChars = 'abcdefghijklmnopqrstuvwxyz0123456789' . split ( '' ) ;
311311 expect ( ( ) =>
312- faker . string . alphaNumeric ( {
312+ faker . string . alphanumeric ( {
313313 count : 5 ,
314314 bannedChars,
315315 casing : 'lower' ,
@@ -324,7 +324,7 @@ describe('string', () => {
324324 it ( 'should throw if all possible characters being banned via string' , ( ) => {
325325 const bannedChars = 'abcdefghijklmnopqrstuvwxyz0123456789' ;
326326 expect ( ( ) =>
327- faker . string . alphaNumeric ( {
327+ faker . string . alphanumeric ( {
328328 count : 5 ,
329329 bannedChars,
330330 casing : 'lower' ,
@@ -341,7 +341,7 @@ describe('string', () => {
341341 count : 5 ,
342342 } ) ;
343343
344- expect ( ( ) => faker . string . alphaNumeric ( input ) ) . not . toThrow ( ) ;
344+ expect ( ( ) => faker . string . alphanumeric ( input ) ) . not . toThrow ( ) ;
345345 expect ( input . bannedChars ) . toEqual ( [ 'a' , '0' , '%' ] ) ;
346346 } ) ;
347347 } ) ;
0 commit comments