Revert "fix: only include frame-runner when running tests (#44337)" (#44419)

This reverts commit a23a47750b.
This commit is contained in:
Nicholas Carrigan (he/him)
2021-12-08 08:40:41 -08:00
committed by GitHub
parent 50b554470d
commit c19bf504b8
3 changed files with 12 additions and 17 deletions

View File

@ -86,8 +86,7 @@ export function* executeChallengeSaga({ payload }) {
const protect = isLoopProtected(challengeMeta);
const buildData = yield buildChallengeData(challengeData, {
preview: false,
protect,
usesTestRunner: true
protect
});
const document = yield getContext('document');
const testRunner = yield call(

View File

@ -130,13 +130,12 @@ async function getDOMTestRunner(buildData, { proxyLogger }, document) {
runTestInTestFrame(document, testString, testTimeout);
}
export function buildDOMChallenge(
{ challengeFiles, required = [], template = '' },
{ usesTestRunner } = { usesTestRunner: false }
) {
const finalRequires = [...required];
if (usesTestRunner) finalRequires.push(...frameRunner);
export function buildDOMChallenge({
challengeFiles,
required = [],
template = ''
}) {
const finalRequires = [...required, ...frameRunner];
const loadEnzyme = challengeFiles.some(
challengeFile => challengeFile.ext === 'jsx'
);

View File

@ -570,14 +570,11 @@ async function createTestRunner(
challengeFile.editableContents = solutionFile.editableContents;
});
const { build, sources, loadEnzyme } = await buildChallenge(
{
challengeFiles,
required,
template
},
{ usesTestRunner: true }
);
const { build, sources, loadEnzyme } = await buildChallenge({
challengeFiles,
required,
template
});
const code = {
contents: sources.index,