Skip to content

Commit

Permalink
test(image): lorempicsum avatar log message
Browse files Browse the repository at this point in the history
  • Loading branch information
xDivisionByZerox committed Jun 12, 2022
1 parent 902fc61 commit 7261007
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/image.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it, vi } from 'vitest';
import { faker } from '../src';

describe('image', () => {
Expand Down Expand Up @@ -62,6 +62,21 @@ describe('image', () => {
)
).toBeTruthy();
});

it('should log a deprecation message', () => {
const consoleSpy = vi.spyOn(console, 'warn');

faker.image.lorempicsum.avatar();

expect(consoleSpy).toHaveBeenCalled();

const logMessage = consoleSpy.mock.calls[0][0];
expect(logMessage).toContain('deprecated');
expect(logMessage).toContain('faker.image.lorempicsum.avatar()');
expect(logMessage).toContain('faker.internet.avatar()');
expect(logMessage).toContain('v7.3.0');
expect(logMessage).toContain('v8.0.0');
});
});

describe('imageGrayscale()', () => {
Expand Down

0 comments on commit 7261007

Please sign in to comment.