aboutsummaryrefslogtreecommitdiff
path: root/test/scripts
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2023-10-11 20:44:51 +0200
committerGitHub <[email protected]>2023-10-11 20:44:51 +0200
commit201d6e30f536c2c1f934270d2c97239522df1926 (patch)
treeb4652b01518a8bfeebc51d01a070e0163e94794f /test/scripts
parent6cb5aa25f676c7f43fd543e1738e71f54ea5fc6f (diff)
downloadfaker-201d6e30f536c2c1f934270d2c97239522df1926.tar.xz
faker-201d6e30f536c2c1f934270d2c97239522df1926.zip
infra(unicorn): no-array-for-each (#2461)
Diffstat (limited to 'test/scripts')
-rw-r--r--test/scripts/apidoc/signature.debug.ts4
-rw-r--r--test/scripts/apidoc/verify-jsdoc-tags.spec.ts10
2 files changed, 7 insertions, 7 deletions
diff --git a/test/scripts/apidoc/signature.debug.ts b/test/scripts/apidoc/signature.debug.ts
index a9ec8fd0..52b6976a 100644
--- a/test/scripts/apidoc/signature.debug.ts
+++ b/test/scripts/apidoc/signature.debug.ts
@@ -12,10 +12,10 @@ const methods = loadExampleMethods();
initMarkdownRenderer()
.then(() => {
- Object.entries(methods).forEach(([name, method]) => {
+ for (const [name, method] of Object.entries(methods)) {
console.log('Analyzing:', name);
const result = analyzeSignature(method, '', method.name);
console.log('Result:', result);
- });
+ }
})
.catch(console.error);
diff --git a/test/scripts/apidoc/verify-jsdoc-tags.spec.ts b/test/scripts/apidoc/verify-jsdoc-tags.spec.ts
index 5b8f5680..64cbcdb4 100644
--- a/test/scripts/apidoc/verify-jsdoc-tags.spec.ts
+++ b/test/scripts/apidoc/verify-jsdoc-tags.spec.ts
@@ -176,9 +176,9 @@ describe('verify JSDoc tags', () => {
});
it('verify @param tags', async () => {
- (
+ for (const param of (
await analyzeSignature(signature, '', methodName)
- ).parameters.forEach((param) => {
+ ).parameters) {
const { name, description } = param;
const plainDescription = description
.replace(/<[^>]+>/g, '')
@@ -188,11 +188,11 @@ describe('verify JSDoc tags', () => {
`Expect param ${name} to have a description`
).not.toBe(MISSING_DESCRIPTION);
assertDescription(description, true);
- });
+ }
});
it('verify @see tags', () => {
- extractSeeAlsos(signature).forEach((link) => {
+ for (const link of extractSeeAlsos(signature)) {
if (link.startsWith('faker.')) {
// Expected @see faker.xxx.yyy()
expect(link, 'Expect method reference to contain ()').toContain(
@@ -203,7 +203,7 @@ describe('verify JSDoc tags', () => {
);
expect(allowedReferences).toContain(link.replace(/\(.*/, ''));
}
- });
+ }
});
it('verify @since tag', () => {