From 5589a3c4b69a77f4053e38fb7cef5f6c963fea4f Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Sat, 30 Jul 2022 23:07:09 +0200 Subject: test: ensure jsdoc deprecated tag to have a message (#1213) --- test/scripts/apidoc/examplesAndDeprecations.spec.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/scripts') diff --git a/test/scripts/apidoc/examplesAndDeprecations.spec.ts b/test/scripts/apidoc/examplesAndDeprecations.spec.ts index 314e72d4..9eb10d39 100644 --- a/test/scripts/apidoc/examplesAndDeprecations.spec.ts +++ b/test/scripts/apidoc/examplesAndDeprecations.spec.ts @@ -6,6 +6,7 @@ import type { SpyInstance } from 'vitest'; import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest'; import { extractRawExamples, + extractTagContent, isDeprecated, } from '../../../scripts/apidoc/utils'; import { faker } from '../../../src'; @@ -101,6 +102,10 @@ describe('examples and deprecations', () => { const deprecatedFlag = isDeprecated(signature); if (deprecatedFlag) { expect(consoleSpies[1]).toHaveBeenCalled(); + expect( + extractTagContent('@deprecated', signature).join(''), + '@deprecated tag without message' + ).not.toBe(''); } else { for (const spy of consoleSpies) { expect(spy).not.toHaveBeenCalled(); -- cgit v1.2.3