From 859012bc2ed786ca94847b310ca61bdd723da277 Mon Sep 17 00:00:00 2001 From: xDivisionByZerox Date: Sun, 12 Jun 2022 01:03:17 +0200 Subject: [PATCH] test(image): add unsplash avatar case --- test/image.spec.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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',