From e7211fc67b849a863b20e905dde4ee1e1e62133e Mon Sep 17 00:00:00 2001 From: Bouncey Date: Tue, 11 Sep 2018 15:06:49 +0100 Subject: [PATCH] Fix challenge tests that rely on --- .../redux/execute-challenge-epic.js | 21 +++++++------------ .../src/templates/Challenges/utils/frame.js | 3 +-- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/packages/learn/src/templates/Challenges/redux/execute-challenge-epic.js b/packages/learn/src/templates/Challenges/redux/execute-challenge-epic.js index 64d2d2085b..b2ff12778f 100644 --- a/packages/learn/src/templates/Challenges/redux/execute-challenge-epic.js +++ b/packages/learn/src/templates/Challenges/redux/execute-challenge-epic.js @@ -26,7 +26,6 @@ import { initConsole, updateConsole, initLogs, - updateLogs, logsToConsole, checkChallenge, updateTests, @@ -51,10 +50,7 @@ function updateMainEpic(actions, { getState }, { document }) { const proxyLogger = new Subject(); const frameMain = createMainFramer(document, getState, proxyLogger); const buildAndFrameMain = actions.pipe( - ofType( - types.updateFile, - types.challengeMounted - ), + ofType(types.updateFile, types.challengeMounted), debounceTime(executeDebounceTimeout), switchMap(() => buildFromFiles(getState(), true).pipe( @@ -75,12 +71,13 @@ function executeChallengeEpic(action$, { getState }, { document }) { filter(Boolean), switchMap(() => { const frameReady = new Subject(); - const proxyLogger = new Subject(); + // Removed for investigation into freeCodeCamp/Learn#291 + // const proxyLogger = new Subject(); const frameTests = createTestFramer( document, getState, - frameReady, - proxyLogger + frameReady + // proxyLogger ); const challengeResults = frameReady.pipe( pluck('checkChallengePayload'), @@ -117,7 +114,7 @@ function executeChallengeEpic(action$, { getState }, { document }) { const build = challengeType === backend ? buildBackendChallenge(state) - : buildFromFiles(state, true); + : buildFromFiles(state, false); return build.pipe( tap(frameTests), ignoreElements(), @@ -127,11 +124,7 @@ function executeChallengeEpic(action$, { getState }, { document }) { ); }) ); - return merge( - buildAndFrameChallenge, - challengeResults, - proxyLogger.map(updateLogs) - ); + return merge(buildAndFrameChallenge, challengeResults); }) ); } diff --git a/packages/learn/src/templates/Challenges/utils/frame.js b/packages/learn/src/templates/Challenges/utils/frame.js index 096324cffe..972bce47e8 100644 --- a/packages/learn/src/templates/Challenges/utils/frame.js +++ b/packages/learn/src/templates/Challenges/utils/frame.js @@ -140,12 +140,11 @@ export const createMainFramer = (document, getState, proxyLogger) => writeContentToFrame ); -export const createTestFramer = (document, getState, frameReady, proxyLogger) => +export const createTestFramer = (document, getState, frameReady) => flow( createFrame(document, getState, testId), mountFrame(document), addDepsToDocument, writeTestDepsToDocument(frameReady), - buildProxyConsole(proxyLogger), writeContentToFrame );