mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-30 16:01:14 -04:00
chore: include e2e folder in lint:ts (#55325)
Co-authored-by: sembauke <semboot699@gmail.com> Co-authored-by: Naomi the Technomancer <accounts+github@nhcarrigan.com>
This commit is contained in:
@@ -73,7 +73,7 @@ const SEO: React.FC<SEOProps> = ({ title, children }) => {
|
||||
const superBlockIntroObj: {
|
||||
title: string;
|
||||
intro: string[];
|
||||
} = t(`intro:${superBlock}`);
|
||||
} = t(`intro:${superBlock}`, { returnObjects: true });
|
||||
|
||||
const { title: i18nTitle, intro: introText } = superBlockIntroObj;
|
||||
|
||||
|
||||
@@ -31,7 +31,22 @@ const publicSB = orderedSuperBlockInfo
|
||||
.filter(sb => sb.public === true && !nonEditorSB.includes(sb.dashedName))
|
||||
.map(sb => sb.dashedName);
|
||||
|
||||
const typedCurriculum = currData as Curriculum;
|
||||
const incompatible = [
|
||||
'certifications',
|
||||
'a2-english-for-developers',
|
||||
'b1-english-for-developers'
|
||||
];
|
||||
|
||||
const removeNonCompatibleSuperblocks = (currData: Curriculum): Curriculum => {
|
||||
const copy = currData;
|
||||
|
||||
for (const superBlock of incompatible) {
|
||||
delete copy[superBlock];
|
||||
}
|
||||
return copy;
|
||||
};
|
||||
|
||||
const typedCurriculum = removeNonCompatibleSuperblocks(currData as never);
|
||||
|
||||
test.describe('Test challenges in mobile', () => {
|
||||
for (const superBlock of publicSB) {
|
||||
|
||||
@@ -3,6 +3,12 @@ import { SuperBlocks } from '../shared/config/superblocks';
|
||||
import type { ListItem } from '../client/src/components/seo/';
|
||||
import metaTags from '../client/i18n/locales/english/meta-tags.json';
|
||||
|
||||
interface StructuredData {
|
||||
'@context': string;
|
||||
'@type': string;
|
||||
itemListElement: ListItem[];
|
||||
}
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/');
|
||||
});
|
||||
@@ -20,7 +26,7 @@ test('should inject structured data (JSON-LD) into the page', async ({
|
||||
|
||||
expect(structuredData).toBeTruthy();
|
||||
|
||||
const parsedData = JSON.parse(structuredData ?? '');
|
||||
const parsedData = JSON.parse(structuredData ?? '') as StructuredData;
|
||||
|
||||
expect(parsedData?.['@context']).toBe('https://schema.org');
|
||||
expect(parsedData['@type']).toBe('ItemList');
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"include": [
|
||||
"curriculum/*.test.ts",
|
||||
"e2e/**/*.ts",
|
||||
"tools/challenge-auditor/index.ts",
|
||||
"tools/challenge-editor/**/*",
|
||||
"tools/challenge-helper-scripts/**/*.ts",
|
||||
|
||||
Reference in New Issue
Block a user