Skip to content

Commit 53c1aea

Browse files
authored
test: rewrite random (#490)
1 parent fceb128 commit 53c1aea

File tree

2 files changed

+135
-168
lines changed

2 files changed

+135
-168
lines changed

src/random.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class Random {
5858
number(
5959
options?: number | { min?: number; max?: number; precision?: number }
6060
): number {
61-
console.log(
61+
console.warn(
6262
'Deprecation Warning: faker.random.number is now located in faker.datatype.number'
6363
);
6464
return this.faker.datatype.number(options);
@@ -86,7 +86,7 @@ export class Random {
8686
float(
8787
options?: number | { min?: number; max?: number; precision?: number }
8888
): number {
89-
console.log(
89+
console.warn(
9090
'Deprecation Warning: faker.random.float is now located in faker.datatype.float'
9191
);
9292
return this.faker.datatype.float(options);
@@ -186,7 +186,7 @@ export class Random {
186186
* @see faker.datatype.uuid()
187187
*/
188188
uuid(): string {
189-
console.log(
189+
console.warn(
190190
'Deprecation Warning: faker.random.uuid is now located in faker.datatype.uuid'
191191
);
192192
return this.faker.datatype.uuid();
@@ -202,7 +202,7 @@ export class Random {
202202
* @see faker.datatype.boolean()
203203
*/
204204
boolean(): boolean {
205-
console.log(
205+
console.warn(
206206
'Deprecation Warning: faker.random.boolean is now located in faker.datatype.boolean'
207207
);
208208
return this.faker.datatype.boolean();
@@ -291,7 +291,7 @@ export class Random {
291291
* @deprecated
292292
*/
293293
image(): string {
294-
console.log(
294+
console.warn(
295295
'Deprecation Warning: faker.random.image is now located in faker.image.image'
296296
);
297297
return this.faker.image.image();
@@ -316,10 +316,11 @@ export class Random {
316316
* @method faker.random.alpha
317317
* @param options // defaults to { count: 1, upcase: false, bannedChars: [] }
318318
*/
319+
// TODO @Shinigami92 2022-02-14: Tests covered `(count, options)`, but they were never typed like that
319320
alpha(
320321
options?:
321322
| number
322-
| { count: number; upcase?: boolean; bannedChars?: string[] }
323+
| { count?: number; upcase?: boolean; bannedChars?: string[] }
323324
): string {
324325
if (typeof options === 'undefined') {
325326
options = {
@@ -455,7 +456,7 @@ export class Random {
455456
* @deprecated
456457
*/
457458
hexaDecimal(count?: number): string {
458-
console.log(
459+
console.warn(
459460
'Deprecation Warning: faker.random.hexaDecimal is now located in faker.datatype.hexaDecimal'
460461
);
461462
return this.faker.datatype.hexaDecimal(count);

0 commit comments

Comments
 (0)