diff options
| author | Shinigami <[email protected]> | 2022-02-15 16:00:09 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-02-15 16:00:09 +0100 |
| commit | 53c1aeaca387a0cec0a9be8adad7e22b1dd560a1 (patch) | |
| tree | 6216acc41f07f70a02a56b780102fc94b49668d6 /src | |
| parent | fceb128e1c95bcaf6f757fdec8e1289f303d0b33 (diff) | |
| download | faker-53c1aeaca387a0cec0a9be8adad7e22b1dd560a1.tar.xz faker-53c1aeaca387a0cec0a9be8adad7e22b1dd560a1.zip | |
test: rewrite random (#490)
Diffstat (limited to 'src')
| -rw-r--r-- | src/random.ts | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/random.ts b/src/random.ts index f3d11f3a..f3c4ffd1 100644 --- a/src/random.ts +++ b/src/random.ts @@ -58,7 +58,7 @@ export class Random { number( options?: number | { min?: number; max?: number; precision?: number } ): number { - console.log( + console.warn( 'Deprecation Warning: faker.random.number is now located in faker.datatype.number' ); return this.faker.datatype.number(options); @@ -86,7 +86,7 @@ export class Random { float( options?: number | { min?: number; max?: number; precision?: number } ): number { - console.log( + console.warn( 'Deprecation Warning: faker.random.float is now located in faker.datatype.float' ); return this.faker.datatype.float(options); @@ -186,7 +186,7 @@ export class Random { * @see faker.datatype.uuid() */ uuid(): string { - console.log( + console.warn( 'Deprecation Warning: faker.random.uuid is now located in faker.datatype.uuid' ); return this.faker.datatype.uuid(); @@ -202,7 +202,7 @@ export class Random { * @see faker.datatype.boolean() */ boolean(): boolean { - console.log( + console.warn( 'Deprecation Warning: faker.random.boolean is now located in faker.datatype.boolean' ); return this.faker.datatype.boolean(); @@ -291,7 +291,7 @@ export class Random { * @deprecated */ image(): string { - console.log( + console.warn( 'Deprecation Warning: faker.random.image is now located in faker.image.image' ); return this.faker.image.image(); @@ -316,10 +316,11 @@ export class Random { * @method faker.random.alpha * @param options // defaults to { count: 1, upcase: false, bannedChars: [] } */ + // TODO @Shinigami92 2022-02-14: Tests covered `(count, options)`, but they were never typed like that alpha( options?: | number - | { count: number; upcase?: boolean; bannedChars?: string[] } + | { count?: number; upcase?: boolean; bannedChars?: string[] } ): string { if (typeof options === 'undefined') { options = { @@ -455,7 +456,7 @@ export class Random { * @deprecated */ hexaDecimal(count?: number): string { - console.log( + console.warn( 'Deprecation Warning: faker.random.hexaDecimal is now located in faker.datatype.hexaDecimal' ); return this.faker.datatype.hexaDecimal(count); |
