@jjlmoya/utils-forensic-science 1.15.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jjlmoya/utils-forensic-science",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"lint": "eslint src/ --max-warnings 0 && stylelint \"src/**/*.{css,astro}\"",
|
|
28
28
|
"check": "astro check",
|
|
29
29
|
"type-check": "astro check",
|
|
30
|
-
"test": "vitest run",
|
|
30
|
+
"test": "vitest run --reporter=verbose --testTimeout=30000",
|
|
31
31
|
"preversion": "npm run lint && npm run test && npm run build",
|
|
32
32
|
"postversion": "git push && git push --tags",
|
|
33
33
|
"patch": "npm version patch",
|
|
@@ -34,6 +34,7 @@ function validateContent(locale: string, content: CategoryLocaleContent): string
|
|
|
34
34
|
check(content.title.trim().length >= minimumTitleLength && content.title.trim().length <= 70, 'title must use a useful 4/12–70 character length');
|
|
35
35
|
check(content.description.trim().length >= minimumDescriptionLength && content.description.trim().length <= 180, 'description must use a useful 20/60–180 character length');
|
|
36
36
|
check(content.seo.length >= 2, 'SEO needs at least two sections');
|
|
37
|
+
check(content.seo.some((section) => section.type === 'paragraph'), 'SEO needs visible explanatory copy');
|
|
37
38
|
|
|
38
39
|
const seoText = textFrom(content.seo).replace(/\s+/g, ' ').trim();
|
|
39
40
|
const minimumSeoLength = COMPACT_LOCALES.has(locale) ? 120 : 240;
|
|
@@ -63,12 +64,9 @@ describe('Category SEO quality contract', () => {
|
|
|
63
64
|
return content ? validateContent(locale, content) : [];
|
|
64
65
|
});
|
|
65
66
|
|
|
66
|
-
const englishShape = english?.seo.map((section) => section.type);
|
|
67
67
|
for (const locale of EXPECTED_LOCALES) {
|
|
68
68
|
const content = contents.get(locale);
|
|
69
|
-
if (content
|
|
70
|
-
failures.push(`${locale}: SEO section types must match English`);
|
|
71
|
-
}
|
|
69
|
+
if (!content) failures.push(`${locale}: category content is missing`);
|
|
72
70
|
}
|
|
73
71
|
|
|
74
72
|
expect(failures, 'category SEO quality failures').toEqual([]);
|