diff --git a/test/scripts/apidocs/verify-jsdoc-tags.spec.ts b/test/scripts/apidocs/verify-jsdoc-tags.spec.ts index dd77620d504..244741c6259 100644 --- a/test/scripts/apidocs/verify-jsdoc-tags.spec.ts +++ b/test/scripts/apidocs/verify-jsdoc-tags.spec.ts @@ -164,54 +164,68 @@ ${examples}`; assertDescription(signature.description); }); - it('verify @example tag', { timeout: 30000 }, async () => { - const examples = signature.examples.join('\n'); - - expect( - examples, - `${moduleName}.${methodName} to have examples` - ).not.toBe(''); - - // Grab path to example file - const path = resolvePathToMethodFile( - moduleName, - methodName, - signatureIndex - ); + it( + 'verify @example tag', + { + retry: 3, + timeout: 30000, + }, + async () => { + const examples = signature.examples.join('\n'); + + expect( + examples, + `${moduleName}.${methodName} to have examples` + ).not.toBe(''); + + // Grab path to example file + const path = resolvePathToMethodFile( + moduleName, + methodName, + signatureIndex + ); - // Executing the examples should not throw - await expect( - import(`${path}?scope=example`), - examples - ).resolves.toBeDefined(); - }); + // Executing the examples should not throw + await expect( + import(`${path}?scope=example`), + examples + ).resolves.toBeDefined(); + } + ); // This only checks whether the whole method is deprecated or not // It does not check whether the method is deprecated for a specific set of arguments - it('verify @deprecated tag', { timeout: 30000 }, async () => { - // Grab path to example file - const path = resolvePathToMethodFile( - moduleName, - methodName, - signatureIndex - ); + it( + 'verify @deprecated tag', + { + retry: 3, + timeout: 30000, + }, + async () => { + // Grab path to example file + const path = resolvePathToMethodFile( + moduleName, + methodName, + signatureIndex + ); - const consoleWarnSpy = vi.spyOn(console, 'warn'); + const consoleWarnSpy = vi.spyOn(console, 'warn'); - // Run the examples - await import(`${path}?scope=deprecated`); + // Run the examples + await import(`${path}?scope=deprecated`); - // Verify that deprecated methods log a warning - const { deprecated } = signature; - if (deprecated == null) { - expect(consoleWarnSpy).not.toHaveBeenCalled(); - } else { - expect(consoleWarnSpy).toHaveBeenCalled(); - expect(deprecated).not.toBe(''); - } + // Verify that deprecated methods log a warning + const { deprecated } = signature; + if (deprecated == null) { + expect(consoleWarnSpy).not.toHaveBeenCalled(); + } else { + expect(consoleWarnSpy).toHaveBeenCalled(); + expect(deprecated).not.toBe(''); + } - consoleWarnSpy.mockRestore(); - }); + consoleWarnSpy.mockRestore(); + } + ); describe.each(signature.parameters.map((p) => [p.name, p]))( '%s',