How does FreeCodeCamp run/test our code. Does it run it in the backend? Does it run it inside the browser itself? I am trying to build something similar to the code runner so this information would help a lot. Thanks
I think it is run in the backend
Sky020
February 11, 2023, 1:41pm
3
Welcome there,
All of freeCodeCamp’s code is publicly visible and open-source:
The tests are run in different ways depending on which challenge you are referring to.
Most of the tests are simple Chaijs assertions running in the browser:
import chai from 'chai';
import '@babel/polyfill';
import { toString as __toString } from 'lodash-es';
import * as helpers from '@freecodecamp/curriculum-helpers';
import { format as __format } from '../../utils/format';
const ctx: Worker & typeof globalThis = self as unknown as Worker &
typeof globalThis;
const __utils = (() => {
const MAX_LOGS_SIZE = 64 * 1024;
let logs: string[] = [];
function flushLogs() {
if (logs.length) {
ctx.postMessage({
type: 'LOG',
data: logs.join('\n')
});
logs = [];
This file has been truncated. show original
Hope this helps