aboutsummaryrefslogtreecommitdiff
path: root/test/scripts
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2022-07-30 23:07:09 +0200
committerGitHub <[email protected]>2022-07-30 23:07:09 +0200
commit5589a3c4b69a77f4053e38fb7cef5f6c963fea4f (patch)
tree8b4991eb7173feead58ea539d1fdc366367e5963 /test/scripts
parentef6fbacfb15225b0f12fb5f6e6f382a0c3ed9915 (diff)
downloadfaker-5589a3c4b69a77f4053e38fb7cef5f6c963fea4f.tar.xz
faker-5589a3c4b69a77f4053e38fb7cef5f6c963fea4f.zip
test: ensure jsdoc deprecated tag to have a message (#1213)
Diffstat (limited to 'test/scripts')
-rw-r--r--test/scripts/apidoc/examplesAndDeprecations.spec.ts5
1 files changed, 5 insertions, 0 deletions
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();