repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/intro-page-rwd.spec.ts | e2e/intro-page-rwd.spec.ts | import { test, expect } from '@playwright/test';
test.describe('Certification intro page', () => {
test('Should render and toggle correctly', async ({ page }) => {
const firstBlockToggle = page.getByRole('button', {
name: 'Learn HTML by Building a Cat Photo App'
});
const firstBlockText = page.get... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/not-found.spec.ts | e2e/not-found.spec.ts | import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import words from '../client/i18n/locales/english/motivation.json';
const pageElements = {
notFoundImage: 'not-found-image',
notFoundHeading: 'not-found-heading',
heresQuoteParagraph: 'he... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/template-challenges-show.spec.ts | e2e/template-challenges-show.spec.ts | import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.describe('Template Challenges Show', () => {
test.beforeEach(async ({ page }) => {
await page.goto(
'/learn/foundational-c-sharp-with-microsoft/write-your-first-code-using-c-s... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/donation-modal.spec.ts | e2e/donation-modal.spec.ts | import { execSync } from 'child_process';
import { test, expect, type Page } from '@playwright/test';
import { addGrowthbookCookie } from './utils/add-growthbook-cookie';
import { clearEditor, focusEditor } from './utils/editor';
import { allowTrailingSlash } from './utils/url';
const slowExpect = expect.configure({ ... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/unsubscribed.spec.ts | e2e/unsubscribed.spec.ts | import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import metaTags from '../client/i18n/locales/english/meta-tags.json';
test.describe('The unsubscribed page without unsubscribeId', () => {
test.beforeEach(async ({ page }) => {
await page... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/map.spec.ts | e2e/map.spec.ts | import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.beforeEach(async ({ page }) => {
await page.goto('/learn');
});
const LANDING_PAGE_LINKS = [
{
slug: 'responsive-web-design-v9',
name: 'Responsive Web Design Certification'
... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/edit-profile-modal.spec.ts | e2e/edit-profile-modal.spec.ts | import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.beforeEach(async ({ page }) => {
await page.goto('/certifieduser');
if (!process.env.CI) {
await page.getByRole('button', { name: 'Preview custom 404 page' }).click();
}
awai... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/update-stripe-card-default.spec.ts | e2e/update-stripe-card-default.spec.ts | import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.describe('Update Card Page for Non-Donor Authenticated User', () => {
test('should render correctly', async ({ page }) => {
await page.goto('/update-stripe-card');
await expect(p... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/update-about-me.spec.ts | e2e/update-about-me.spec.ts | import { execSync } from 'child_process';
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.beforeEach(async ({ page }) => {
execSync(
'node ./tools/scripts/seed/seed-demo-user --certified-user --set-false isFullStackCert'
);
a... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/signin.spec.ts | e2e/signin.spec.ts | import { test, expect } from '@playwright/test';
test.describe('signing in', () => {
test.use({ storageState: { cookies: [], origins: [] } });
test('welcomes the user', async ({ page }) => {
const welcomeText = 'Welcome back, Full Stack User.';
await page.goto('/learn');
await expect(page.getByText(wel... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/exam-survey.spec.ts | e2e/exam-survey.spec.ts | import { execSync } from 'child_process';
import { test, expect } from '@playwright/test';
const url =
'/learn/foundational-c-sharp-with-microsoft/foundational-c-sharp-with-microsoft-certification-exam/foundational-c-sharp-with-microsoft-certification-exam';
test.describe('Exam Survey', () => {
test.beforeAll(() =>... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/tags.spec.ts | e2e/tags.spec.ts | import { test, expect } from '@playwright/test';
const challenges = {
responsiveWebDesign:
'/learn/responsive-web-design/basic-html-and-html5/say-hello-to-html-elements',
rosettaCode: '/learn/rosetta-code/rosetta-code-challenges/100-doors',
projectEuler:
'/learn/project-euler/project-euler-problems-1-to-... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/backend.spec.ts | e2e/backend.spec.ts | import { test, expect } from '@playwright/test';
const locations = {
index:
'learn/back-end-development-and-apis/managing-packages-with-npm/' +
'how-to-use-package-json-the-core-of-any-node-js-project-or-npm-package',
project:
'/learn/back-end-development-and-apis/back-end-development-and-apis-projects... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/learn.spec.ts | e2e/learn.spec.ts | import { test, expect } from '@playwright/test';
import words from '../client/i18n/locales/english/motivation.json';
test.describe('Learn - Unauthenticated user', () => {
test.use({ storageState: { cookies: [], origins: [] } });
test('the page should render correctly', async ({ page }) => {
await page.goto('/... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/search-bar-optimized.spec.ts | e2e/search-bar-optimized.spec.ts | import { test, expect, type Page } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
const getSearchInput = async ({
page,
isMobile
}: {
page: Page;
isMobile: boolean;
}) => {
if (isMobile) {
const menuButton = page.getByRole('button', {
name: tra... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/settings.spec.ts | e2e/settings.spec.ts | import { execSync } from 'child_process';
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import {
currentCertifications,
legacyCertifications as legacyCerts
} from '../shared/config/certification-settings';
import { alertToBeVisible } f... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/sass.spec.ts | e2e/sass.spec.ts | import { test, expect } from '@playwright/test';
test.describe('Sass Challenge', () => {
test.beforeEach(async ({ page }) => {
await page.goto(
'/learn/front-end-development-libraries/sass/use-for-to-create-a-sass-loop'
);
});
test('should render the sass preview', async ({ page, isMobile }) => {
... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/certification.spec.ts | e2e/certification.spec.ts | import { execSync } from 'child_process';
import { test, expect, Page } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import { alertToBeVisible } from './utils/alerts';
import {
deleteAllEmails,
getAllEmails,
getFirstEmail,
getSubject
} from './utils/mailh... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/hotkeys.spec.ts | e2e/hotkeys.spec.ts | import { test, expect, type Page } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import { authedRequest } from './utils/request';
import { getEditors } from './utils/editor';
import { alertToBeVisible } from './utils/alerts';
const links = {
basicJS1:
'/le... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/side-panel.spec.ts | e2e/side-panel.spec.ts | import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.beforeEach(async ({ page }) => {
await page.goto(
'/learn/javascript-algorithms-and-data-structures/basic-javascript/declare-javascript-variables'
);
});
test.describe('Challenge ... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/four-oh-four.spec.ts | e2e/four-oh-four.spec.ts | import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.beforeEach(async ({ page }) => {
await page.goto('/404');
});
test.describe('FourOhFour component', () => {
test('should display the content correctly', async ({ page }) => {
cons... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/challenge-description.spec.ts | e2e/challenge-description.spec.ts | import { test, expect } from '@playwright/test';
test.beforeEach(async ({ page }) => {
await page.goto(
'/learn/foundational-c-sharp-with-microsoft/write-your-first-code-using-c-sharp/trophy-write-your-first-code-using-c-sharp'
);
});
test.describe('Challenge Description Component Tests', () => {
test('shou... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/quincy-email-sign-up.spec.ts | e2e/quincy-email-sign-up.spec.ts | import { execSync } from 'child_process';
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import { allowTrailingSlash } from './utils/url';
const apiLocation = process.env.API_LOCATION || 'http://localhost:3000';
test.describe('Email sign... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/image-picture-check.spec.ts | e2e/image-picture-check.spec.ts | import { test, expect } from '@playwright/test';
test.describe('Picture input field', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/certifieduser');
if (!process.env.CI) {
await page
.getByRole('button', { name: 'Preview custom 404 page' })
.click();
}
await ... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/output.spec.ts | e2e/output.spec.ts | import { test, expect, type Page } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import { clearEditor, focusEditor, getEditors } from './utils/editor';
const outputTexts = {
default: `
/**
* Your test output will go here
*/`,
syntaxError: `SyntaxError:... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/code-storage.spec.ts | e2e/code-storage.spec.ts | import { test, expect } from '@playwright/test';
import { getEditors } from './utils/editor';
test.describe('Challenge with editor', function () {
test.skip(({ isMobile }) => isMobile);
test('the shortcut "Ctrl + S" saves the code', async ({ page }) => {
await page.goto(
'/learn/2022/responsive-web-desi... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/username-change.spec.ts | e2e/username-change.spec.ts | import { execSync } from 'child_process';
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.afterAll(() => {
// change the name back to the original
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user');
});
const set... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/interactive-editor.spec.ts | e2e/interactive-editor.spec.ts | import { test, expect } from '@playwright/test';
interface InteractiveFile {
contents: string;
ext: string;
name: string;
contentsHtml: string;
}
interface Nodule {
type: 'paragraph' | 'interactiveEditor';
data: string | InteractiveFile[];
}
interface PageData {
result: {
data: {
challengeNod... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/search-bar.spec.ts | e2e/search-bar.spec.ts | import { test, expect, type Page } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import algoliaEightHits from './fixtures/algolia-eight-hits.json';
import algoliaFiveHits from './fixtures/algolia-five-hits.json';
import algoliaNoHits from './fixtures/algolia-no-hi... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/settings-sidenav.spec.ts | e2e/settings-sidenav.spec.ts | import { test, expect } from '@playwright/test';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
// Set viewport to desktop size to ensure sideNav is visible
await page.setViewportSize({ width: 1280, height: 720 });
await page.goto('/settings');
// Wa... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/video-modal.spec.ts | e2e/video-modal.spec.ts | import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
const currentUrlPath =
'/learn/responsive-web-design/responsive-web-design-principles/create-a-media-query';
test.beforeEach(async ({ page }) => {
await page.goto(currentUrlPath);
await ... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/email-sign-up-alert.spec.ts | e2e/email-sign-up-alert.spec.ts | import { execSync } from 'child_process';
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import { alertToBeVisible } from './utils/alerts';
test.describe('Email sign-up page when user is not signed in', () => {
test.use({ storageState: {... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/tool-panel.spec.ts | e2e/tool-panel.spec.ts | import { expect, test } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.describe('Tool Panel', () => {
test.beforeEach(async ({ page }) => {
await page.goto(
'/learn/responsive-web-design/responsive-web-design-principles/create-a-media-query'
)... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/coding-interview-prep-intro-page.spec.ts | e2e/coding-interview-prep-intro-page.spec.ts | import { test, expect, type Page } from '@playwright/test';
test.describe('Certification intro page', () => {
let page: Page;
test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
await page.goto('/learn/coding-interview-prep/');
});
test('Should have a relevant page title', async (... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/exam-results-modal.spec.ts | e2e/exam-results-modal.spec.ts | import { test, expect } from '@playwright/test';
test.describe('Exam results modal', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/settings');
});
test('should display the content correctly', async ({ page }) => {
const viewButton = page.getByRole('button', {
name: 'View Results ... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/finish-exam-modal.spec.ts | e2e/finish-exam-modal.spec.ts | import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
const examUrl =
'/learn/foundational-c-sharp-with-microsoft/foundational-c-sharp-with-microsoft-certification-exam/foundational-c-sharp-with-microsoft-certification-exam';
const QUESTION_COUN... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/challenge-title.spec.ts | e2e/challenge-title.spec.ts | import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.beforeEach(async ({ page }) => {
await page.goto(
'/learn/information-security/python-for-penetration-testing/developing-a-port-scanner'
);
});
test.describe('Challenge Title Comp... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/landing.spec.ts | e2e/landing.spec.ts | import { expect, Page, test } from '@playwright/test';
import intro from '../client/i18n/locales/english/intro.json';
import translations from '../client/i18n/locales/english/translations.json';
import { SuperBlocks } from '../shared/config/curriculum';
import { addGrowthbookCookie } from './utils/add-growthbook-cookie... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/help-button.spec.ts | e2e/help-button.spec.ts | import { test, expect } from '@playwright/test';
test.describe('help-button tests for a page with three links (hint, help and video)', () => {
test('should render the button, menu and the three links when video is available', async ({
page
}) => {
// visit the page with the video link
await page.goto(
... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/archive.spec.ts | e2e/archive.spec.ts | import { expect, test } from '@playwright/test';
import intro from '../client/i18n/locales/english/intro.json';
import { SuperBlocks } from '../shared/config/curriculum';
const archivedSuperBlocks = [
intro[SuperBlocks.RespWebDesignNew].title,
intro[SuperBlocks.JsAlgoDataStructNew].title,
intro[SuperBlocks.Front... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/test-suite.spec.ts | e2e/test-suite.spec.ts | import { test, expect, type Page } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
const runChallengeTest = async (page: Page, isMobile: boolean) => {
if (isMobile) {
await page.getByText('Run').click();
} else {
await page.getByText('Run the Tests (Ctr... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/exam-started-show.spec.ts | e2e/exam-started-show.spec.ts | import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import intro from '../client/i18n/locales/english/intro.json';
const examUrl =
'/learn/foundational-c-sharp-with-microsoft/foundational-c-sharp-with-microsoft-certification-exam/foundational-... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/donate-page-donor.spec.ts | e2e/donate-page-donor.spec.ts | import { execSync } from 'child_process';
import { test, expect } from '@playwright/test';
test.describe('Donate page', () => {
test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeEach(async ({ page }) => {
execSync('node ./tools/scripts/seed/seed-demo-user --set-true isDonating')... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/portfolio.spec.ts | e2e/portfolio.spec.ts | import { execSync } from 'child_process';
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user');
}... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/solution-viewer.spec.ts | e2e/solution-viewer.spec.ts | import { test, expect } from '@playwright/test';
test.describe('Solution Viewer component', () => {
test('renders the modal correctly', async ({ page }) => {
await page.goto(
'/certification/certifieduser/javascript-algorithms-and-data-structures'
);
await page.getByRole('button', { name: /view/i ... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/cert-username-case-navigation.spec.ts | e2e/cert-username-case-navigation.spec.ts | import { execSync } from 'child_process';
import { expect, test } from '@playwright/test';
test.describe('Public profile certifications', () => {
test('Should show claimed certifications if the username has all lowercase characters', async ({
page
}) => {
await page.goto('/certifieduser');
// If you b... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/lower-jaw.spec.ts | e2e/lower-jaw.spec.ts | import { test, expect } from '@playwright/test';
import { clearEditor, focusEditor, getEditors } from './utils/editor';
import { signout } from './utils/logout';
test('Check the initial states of submit button and "check your code" button', async ({
page
}) => {
await page.goto(
'/learn/2022/responsive-web-des... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/editor.spec.ts | e2e/editor.spec.ts | import { APIRequestContext, expect, test } from '@playwright/test';
import { clearEditor, focusEditor, getEditors } from './utils/editor';
import { authedRequest } from './utils/request';
const setTheme = async (
request: APIRequestContext,
theme: 'default' | 'night'
) =>
authedRequest({
request,
endpoi... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/donate-page-default.spec.ts | e2e/donate-page-default.spec.ts | import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import { addGrowthbookCookie } from './utils/add-growthbook-cookie';
const pageElements = {
mainHeading: 'main-head',
donateText1: 'donate-text-1',
donateText2: 'donate-text-2',
donateT... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/internet-presence-settings.spec.ts | e2e/internet-presence-settings.spec.ts | import { execSync } from 'child_process';
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
const settingsPageElement = {
githubInput: 'internet-github-input',
githubCheckmark: 'internet-github-check',
linkedinCheckmark: 'internet-linked... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/delete-modal.spec.ts | e2e/delete-modal.spec.ts | import { exec } from 'child_process';
import { promisify } from 'util';
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
const execP = promisify(exec);
test.beforeEach(async ({ page }) => {
await page.goto('/settings');
});
test.afterAl... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/global-setup.ts | e2e/global-setup.ts | import { execSync } from 'child_process';
import { test as setup } from '@playwright/test';
setup.describe('certifieduser', () => {
setup.use({ storageState: { cookies: [], origins: [] } });
setup.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user ');
});
setup('can si... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/scrollbar-width.spec.ts | e2e/scrollbar-width.spec.ts | import { test, expect } from '@playwright/test';
test.describe('Editor scrollbar width', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/settings');
});
test('Default editor scrollbar width should be 5px', async ({ page }) => {
await expect(page.locator('#scrollbar-width-slider')).toHave... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/footer.spec.ts | e2e/footer.spec.ts | import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import links from '../client/i18n/locales/english/links.json';
const BOTTOM_LINKS = [
{
title: translations.footer.links.about,
href: links.footer['about-url']
},
{
title: tra... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/utils/logout.ts | e2e/utils/logout.ts | import { Page } from '@playwright/test';
export async function signout(page: Page) {
await page.context().clearCookies({ name: 'jwt_access_token' });
}
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/utils/editor.ts | e2e/utils/editor.ts | import { type Page } from '@playwright/test';
export const getEditors = (page: Page) => {
return page.getByRole('textbox', { name: /editor content/i });
};
export const focusEditor = async ({
page,
isMobile
}: {
page: Page;
isMobile: boolean;
}) => {
if (isMobile) {
const codeBtn = page.getByRole('tab... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/utils/user-agent.ts | e2e/utils/user-agent.ts | export const isMacOS = process.platform === 'darwin';
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/utils/alerts.ts | e2e/utils/alerts.ts | import { expect, type Page } from '@playwright/test';
export const alertToBeVisible = async (page: Page, text: string) =>
await expect(page.getByRole('alert').filter({ hasText: text })).toBeVisible();
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/utils/url.ts | e2e/utils/url.ts | export const allowTrailingSlash = (url: string) => RegExp(url + '[/]?$');
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/utils/add-growthbook-cookie.ts | e2e/utils/add-growthbook-cookie.ts | import { BrowserContext } from '@playwright/test';
export async function addGrowthbookCookie({
context,
variation
}: {
context: BrowserContext;
variation: string;
}) {
await context.addCookies([
{
name: 'gbuuid',
value: variation,
// Weirdly, it seems necessary to prefix the domain with... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/utils/mailhog.ts | e2e/utils/mailhog.ts | type Email = {
Subject: string;
ID: string;
From: { Address: string; Name: string };
To: Array<{ Address: string; Name: string }>;
};
type AllEmails = {
messages: Email[];
total: number;
count: number;
};
// TODO: Remove MAILHOG_HOST in a few months
// We renamed MailHog to MailPit, but kept the same po... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/e2e/utils/request.ts | e2e/utils/request.ts | import { APIRequestContext, expect } from '@playwright/test';
const ensureLeadingSlash = (endpoint: string) =>
endpoint[0] === '/' ? endpoint : '/' + endpoint;
export const authedRequest = async ({
request,
method,
endpoint,
data
}: {
request: APIRequestContext;
method: 'post' | 'put';
endpoint: strin... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/vitest.utils.test.ts | api/vitest.utils.test.ts | import { describe, test, expect } from 'vitest';
import { getCsrfToken, getCookies, serializeDates } from './vitest.utils.js';
const fakeCookies = [
'_csrf=123; Path=/; HttpOnly; SameSite=Strict',
'csrf_token=abc-123; Path=/',
'sessionId=CV-abc.123; Path=/; Expires=Wed, 03 May 2023 16:29:53 GMT; HttpOnly'
];
de... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/vitest.utils.ts | api/vitest.utils.ts | /* eslint-disable jsdoc/require-jsdoc */
import { beforeAll, afterAll, expect, vi } from 'vitest';
import request from 'supertest';
import { build, buildOptions } from './src/app.js';
import { createUserInput } from './src/utils/create-user.js';
import { examJson } from './__mocks__/exam.js';
import { CSRF_COOKIE, CSR... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/prisma.config.ts | api/prisma.config.ts | import type { PrismaConfig } from 'prisma';
export default {
schema: 'prisma'
} satisfies PrismaConfig;
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/tools/exam-environment/generate/insert.ts | api/tools/exam-environment/generate/insert.ts | import { readFile } from 'fs/promises';
import { ExamEnvironmentExam, PrismaClient } from '@prisma/client';
import { MONGOHQ_URL } from '../../../src/utils/env.js';
const args = process.argv.slice(2);
const EXAM_JSON_PATH = args[0];
const prisma = new PrismaClient({
datasources: {
db: {
url: MONGOHQ_URL
... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/tools/exam-environment/generate/deprecate.ts | api/tools/exam-environment/generate/deprecate.ts | import { PrismaClient } from '@prisma/client';
import { MONGOHQ_URL } from '../../../src/utils/env.js';
const args = process.argv.slice(2);
const ENV_EXAM_ID = args[0];
if (!ENV_EXAM_ID) {
throw Error('First argument must be the EnvExam _id');
}
const prisma = new PrismaClient({
datasources: {
db: {
ur... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/tools/exam-environment/generate/index.ts | api/tools/exam-environment/generate/index.ts | import { PrismaClient } from '@prisma/client';
import { generateExam } from '../../../src/exam-environment/utils/exam-environment.js';
import { MONGOHQ_URL } from '../../../src/utils/env.js';
const args = process.argv.slice(2);
const ENV_EXAM_ID = args[0];
const NUMBER_OF_EXAMS_TO_GENERATE = Number(args[1]);
if (!ENV... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/tools/exam-environment/test/index.ts | api/tools/exam-environment/test/index.ts | //! Check the records on the database matches the Prisma schema
//!
//! This script should be run, before any deployments with Exam schema changes.
//! WARNING: This script queries every single record in the `Env<>` collections.
import { PrismaClient } from '@prisma/client';
import { PrismaClientKnownRequestError } fro... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/tools/exam-environment/seed/index.ts | api/tools/exam-environment/seed/index.ts | import { PrismaClient } from '@prisma/client';
import * as mocks from '../../../__mocks__/exam-environment-exam.js';
import { MONGOHQ_URL } from '../../../src/utils/env.js';
const prisma = new PrismaClient({
datasources: {
db: {
url: MONGOHQ_URL
}
}
});
async function main() {
await prisma.$connec... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas.ts | api/src/schemas.ts | export { getPublicProfile } from './schemas/users/get-public-profile.js';
export { userExists } from './schemas/users/exists.js';
export { certSlug } from './schemas/certificate/cert-slug.js';
export { certificateVerify } from './schemas/certificate/certificate-verify.js';
export { backendChallengeCompleted } from './s... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/server.ts | api/src/server.ts | import './instrument.js';
import { build, buildOptions } from './app.js';
import { HOST, PORT } from './utils/env.js';
const start = async () => {
const fastify = await build(buildOptions);
const stop = async (signal: NodeJS.Signals) => {
fastify.log.info(`Received ${signal}, shutting down.`);
await fast... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/app.ts | api/src/app.ts | import { randomBytes } from 'crypto';
import fastifyAccepts from '@fastify/accepts';
import fastifySwagger from '@fastify/swagger';
import fastifySwaggerUI from '@fastify/swagger-ui';
import type { TypeBoxTypeProvider } from '@fastify/type-provider-typebox';
import uriResolver from 'fast-uri';
import Fastify, {
Fasti... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/instrument.ts | api/src/instrument.ts | import * as Sentry from '@sentry/node';
import type { FastifyError } from 'fastify';
import {
DEPLOYMENT_VERSION,
SENTRY_DSN,
SENTRY_ENVIRONMENT
} from './utils/env.js';
const shouldIgnoreError = (error: FastifyError): boolean => {
return !!error.statusCode && error.statusCode < 500;
};
// Ensure to call thi... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schema.test.ts | api/src/schema.test.ts | import { describe, test, expect } from 'vitest';
import secureSchema from 'ajv/lib/refs/json-schema-secure.json' with { type: 'json' };
import { Ajv } from 'ajv';
import * as schemas from './schemas.js';
// it's not strict, but that's okay - we're not using it to validate data
const ajv = new Ajv({ strictTypes: false... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/reset.d.ts | api/src/reset.d.ts | import '@total-typescript/ts-reset';
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/server.test.ts | api/src/server.test.ts | import { describe, test, expect, vi } from 'vitest';
import { setupServer, superRequest } from '../vitest.utils.js';
import { HOME_LOCATION } from './utils/env.js';
vi.mock('./utils/env', async importOriginal => {
const actual = await importOriginal<typeof import('./utils/env.js')>();
return {
...actual,
C... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/types.ts | api/src/schemas/types.ts | import { Type } from '@fastify/type-provider-typebox';
export const genericError = Type.Object({
message: Type.Literal('flash.generic-error'),
type: Type.Literal('danger')
});
export const isCertMap = Type.Object({
isA2EnglishCert: Type.Boolean(),
isRespWebDesignCert: Type.Boolean(),
isRespWebDesignCertV9: ... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/donate/update-stripe-card.ts | api/src/schemas/donate/update-stripe-card.ts | import { Type } from '@fastify/type-provider-typebox';
import { genericError } from '../types.js';
export const updateStripeCard = {
body: Type.Object({}),
response: {
200: Type.Object({
sessionId: Type.String()
}),
default: genericError
}
};
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/donate/add-donation.ts | api/src/schemas/donate/add-donation.ts | import { Type } from '@fastify/type-provider-typebox';
export const addDonation = {
body: Type.Object({}),
response: {
200: Type.Object({
isDonating: Type.Boolean()
}),
400: Type.Object({
message: Type.Literal('User is already donating.'),
type: Type.Literal('info')
}),
500: T... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/donate/create-stripe-payment-intent.ts | api/src/schemas/donate/create-stripe-payment-intent.ts | import { Type } from '@fastify/type-provider-typebox';
export const createStripePaymentIntent = {
body: Type.Object({
amount: Type.Number(),
duration: Type.Literal('month'),
email: Type.String({ format: 'email', maxLength: 1024 }),
name: Type.String()
}),
response: {
200: Type.Object({
... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/donate/charge-stripe.ts | api/src/schemas/donate/charge-stripe.ts | import { Type } from '@fastify/type-provider-typebox';
export const chargeStripe = {
body: Type.Object({
amount: Type.Number(),
duration: Type.Literal('month'),
email: Type.String({ format: 'email', maxLength: 1024 }),
subscriptionId: Type.String()
}),
response: {
200: Type.Object({
isD... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/donate/charge-stripe-card.ts | api/src/schemas/donate/charge-stripe-card.ts | import { Type } from '@fastify/type-provider-typebox';
export const chargeStripeCard = {
body: Type.Object({
paymentMethodId: Type.String(),
amount: Type.Number(),
duration: Type.Literal('month')
}),
response: {
200: Type.Object({
isDonating: Type.Boolean(),
type: Type.Literal('succes... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/sentry/event.ts | api/src/schemas/sentry/event.ts | import { Type } from '@fastify/type-provider-typebox';
export const sentryPostEvent = {
body: Type.Object({
text: Type.String()
}),
response: {
500: Type.Object({
message: Type.Literal('flash.generic-error'),
type: Type.Literal('danger')
})
}
};
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/user/report-user.ts | api/src/schemas/user/report-user.ts | import { Type } from '@fastify/type-provider-typebox';
import { genericError } from '../types.js';
export const reportUser = {
body: Type.Object({
username: Type.String(),
reportDescription: Type.String({ minLength: 1 })
}),
response: {
200: Type.Object({
type: Type.Literal('info'),
messa... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/user/post-ms-username.ts | api/src/schemas/user/post-ms-username.ts | import { Type } from '@fastify/type-provider-typebox';
import { genericError } from '../types.js';
export const postMsUsername = {
body: Type.Object({
msTranscriptUrl: Type.String({ maxLength: 1000 })
}),
response: {
200: Type.Object({
msUsername: Type.String()
}),
400: Type.Object({
... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/user/reset-my-progress.ts | api/src/schemas/user/reset-my-progress.ts | import { Type } from '@fastify/type-provider-typebox';
import { genericError } from '../types.js';
export const resetMyProgress = {
response: {
200: Type.Object({}),
default: genericError
}
};
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/user/submit-survey.ts | api/src/schemas/user/submit-survey.ts | import { Type } from '@fastify/type-provider-typebox';
import { surveyTitles } from '../types.js';
export const submitSurvey = {
body: Type.Object({
surveyResults: Type.Object({
title: surveyTitles,
responses: Type.Array(
Type.Object({
question: Type.String(),
response: Ty... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/user/delete-user-token.ts | api/src/schemas/user/delete-user-token.ts | import { Type } from '@fastify/type-provider-typebox';
import { genericError } from '../types.js';
export const deleteUserToken = {
response: {
200: Type.Object({
userToken: Type.Null()
}),
404: Type.Object({
message: Type.Literal('userToken not found'),
type: Type.Literal('info')
}... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/user/delete-ms-username.ts | api/src/schemas/user/delete-ms-username.ts | import { Type } from '@fastify/type-provider-typebox';
export const deleteMsUsername = {
response: {
200: Type.Object({ msUsername: Type.Null() }),
500: Type.Object({
message: Type.Literal('flash.ms.transcript.unlink-err'),
type: Type.Literal('error')
})
}
};
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/user/delete-my-account.ts | api/src/schemas/user/delete-my-account.ts | import { Type } from '@fastify/type-provider-typebox';
import { genericError } from '../types.js';
export const deleteMyAccount = {
response: {
200: Type.Object({}),
default: genericError
}
};
export const deleteUser = {
params: Type.Object({
userId: Type.String({ format: 'objectid', maxLength: 24, ... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/user/get-session-user.ts | api/src/schemas/user/get-session-user.ts | import { Type } from '@fastify/type-provider-typebox';
import { examResults, profileUI, savedChallenge } from '../types.js';
const languages = Type.Array(
Type.Union([Type.Literal('javascript'), Type.Literal('python')])
);
export const getSessionUser = {
response: {
200: Type.Object({
user: Type.Record(... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/user/exam-environment-token.ts | api/src/schemas/user/exam-environment-token.ts | import { Type } from '@fastify/type-provider-typebox';
import { STANDARD_ERROR } from '../../exam-environment/utils/errors.js';
export const userExamEnvironmentToken = {
response: {
201: Type.Object({
examEnvironmentAuthorizationToken: Type.String()
}),
403: STANDARD_ERROR
// default: STANDARD_... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/certificate/cert-slug.ts | api/src/schemas/certificate/cert-slug.ts | import { Type } from '@fastify/type-provider-typebox';
import { Certification } from '../../../../shared/config/certification-settings.js';
import { genericError } from '../types.js';
export const certSlug = {
params: Type.Object({
certSlug: Type.String(),
username: Type.String()
}),
response: {
// T... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/certificate/certificate-verify.ts | api/src/schemas/certificate/certificate-verify.ts | import { Type } from '@fastify/type-provider-typebox';
import { genericError, isCertMap } from '../types.js';
export const certificateVerify = {
// TODO(POST_MVP): Remove partial validation from route for schema validation
body: Type.Object({
certSlug: Type.String({ maxLength: 1024 })
}),
response: {
2... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/email-subscription/resubscribe.ts | api/src/schemas/email-subscription/resubscribe.ts | import { Type } from '@fastify/type-provider-typebox';
export const resubscribe = {
params: Type.Object({
unsubscribeId: Type.String({
minLength: 1
})
})
};
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/email-subscription/unsubscribe.ts | api/src/schemas/email-subscription/unsubscribe.ts | import { Type } from '@fastify/type-provider-typebox';
export const unsubscribe = {
params: Type.Object({
unsubscribeId: Type.String({
minLength: 1
})
})
};
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/signout/signout.ts | api/src/schemas/signout/signout.ts | import { Type } from '@fastify/type-provider-typebox';
import { genericError } from '../types.js';
export const signout = {
response: {
200: Type.Object({}),
default: genericError
}
};
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/settings/update-my-about.ts | api/src/schemas/settings/update-my-about.ts | import { Type } from '@fastify/type-provider-typebox';
export const updateMyAbout = {
body: Type.Object({
// TODO(Post-MVP): make these required
about: Type.Optional(Type.String()),
name: Type.Optional(Type.String()),
picture: Type.Optional(Type.String()),
location: Type.Optional(Type.String())
... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/api/src/schemas/settings/update-my-classroom-mode.ts | api/src/schemas/settings/update-my-classroom-mode.ts | import { Type } from '@fastify/type-provider-typebox';
import { genericError } from '../types.js';
export const updateMyClassroomMode = {
body: Type.Object({
isClassroomAccount: Type.Boolean()
}),
response: {
200: Type.Object({
message: Type.Literal('flash.classroom-mode-updated'),
type: Type... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.