File tree 3 files changed +1
-18
lines changed
3 files changed +1
-18
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,6 @@ export type NumericChar =
79
79
export type AlphaChar = LowerAlphaChar | UpperAlphaChar ;
80
80
export type AlphaNumericChar = AlphaChar | NumericChar ;
81
81
82
- const SAMPLE_MAX_LENGTH = 2 ** 20 ;
83
-
84
82
/**
85
83
* Module to generate string related entries.
86
84
*
@@ -621,7 +619,7 @@ export class StringModule extends SimpleModuleBase {
621
619
/**
622
620
* Returns a string containing UTF-16 chars between 33 and 125 (`!` to `}`).
623
621
*
624
- * @param length Length of the generated string. Max length is `2^20`. Defaults to `10`.
622
+ * @param length Length of the generated string. Defaults to `10`.
625
623
* @param length.min The minimum number of characters to generate.
626
624
* @param length.max The maximum number of characters to generate.
627
625
*
@@ -647,9 +645,6 @@ export class StringModule extends SimpleModuleBase {
647
645
} = 10
648
646
) : string {
649
647
length = this . faker . helpers . rangeToNumber ( length ) ;
650
- if ( length >= SAMPLE_MAX_LENGTH ) {
651
- length = SAMPLE_MAX_LENGTH ;
652
- }
653
648
654
649
const charCodeOption = {
655
650
min : 33 ,
Original file line number Diff line number Diff line change @@ -330,12 +330,6 @@ describe('datatype', () => {
330
330
expect ( generatedString ) . toBe ( '' ) ;
331
331
expect ( generatedString ) . toHaveLength ( 0 ) ;
332
332
} ) ;
333
-
334
- it ( 'should return string with length of 2^20 if bigger length value is passed' , ( ) => {
335
- const overMaxValue = Math . pow ( 2 , 28 ) ;
336
- const generatedString = faker . datatype . string ( overMaxValue ) ;
337
- expect ( generatedString ) . toHaveLength ( Math . pow ( 2 , 20 ) ) ;
338
- } ) ;
339
333
} ) ;
340
334
341
335
describe ( 'boolean' , ( ) => {
Original file line number Diff line number Diff line change @@ -724,12 +724,6 @@ describe('string', () => {
724
724
expect ( generatedString ) . toHaveLength ( 0 ) ;
725
725
} ) ;
726
726
727
- it ( 'should return string with length of 2^20 if bigger length value is passed' , ( ) => {
728
- const overMaxValue = 2 ** 28 ;
729
- const generatedString = faker . string . sample ( overMaxValue ) ;
730
- expect ( generatedString ) . toHaveLength ( 2 ** 20 ) ;
731
- } ) ;
732
-
733
727
it ( 'should return string with a specific length' , ( ) => {
734
728
const length = 1337 ;
735
729
const generatedString = faker . string . sample ( length ) ;
You can’t perform that action at this time.
0 commit comments