Skip to content

Commit

Permalink
test(image): add unsplash avatar case
Browse files Browse the repository at this point in the history
  • Loading branch information
xDivisionByZerox committed Jun 11, 2022
1 parent f17278f commit 859012b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 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 @@ -216,6 +216,22 @@ describe('image', () => {
});
});

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

faker.image.unsplash.avatar();

expect(consoleSpy).toHaveBeenCalled();

const logMessage = consoleSpy.mock.calls[0][0];
expect(logMessage).toContain('faker.image.unsplash.avatar()');
expect(logMessage).toContain('faker.image.avatar()');
expect(logMessage).toContain('v7.2.0');
expect(logMessage).toContain('v8.0.0');
});
});

const categories = [
'buildings',
'food',
Expand Down

0 comments on commit 859012b

Please sign in to comment.