diff --git a/test/image.spec.ts b/test/image.spec.ts index bbb99ffaaab..358c1311dc1 100644 --- a/test/image.spec.ts +++ b/test/image.spec.ts @@ -1,4 +1,4 @@ -import { describe, expect, it } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { faker } from '../src'; describe('image', () => { @@ -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',