diff --git a/client/commonFramework/execute-challenge-stream.js b/client/commonFramework/execute-challenge-stream.js index de7e102751..181868e581 100644 --- a/client/commonFramework/execute-challenge-stream.js +++ b/client/commonFramework/execute-challenge-stream.js @@ -15,6 +15,7 @@ window.common = (function(global) { common.executeChallenge$ = function executeChallenge$() { const code = common.editor.getValue(); + const originalCode = code; const head = common.arrayToNewLineString(common.head); const tail = common.arrayToNewLineString(common.tail); @@ -75,6 +76,7 @@ window.common = (function(global) { data, code, userTests, + originalCode, output: data.output.replace(/\\\"/gi, '') }); }); diff --git a/client/commonFramework/run-tests-stream.js b/client/commonFramework/run-tests-stream.js index b33718bb09..df5bc39dbd 100644 --- a/client/commonFramework/run-tests-stream.js +++ b/client/commonFramework/run-tests-stream.js @@ -5,14 +5,19 @@ window.common = (function(global) { common = { init: [] } } = global; - common.runTests$ = function runTests$({ code, userTests, ...rest }) { + common.runTests$ = function runTests$({ + code, + originalCode, + userTests, + ...rest + }) { return Observable.from(userTests) .map(function(test) { /* eslint-disable no-unused-vars */ const assert = chai.assert; - const editor = { getValue() { return code; }}; + const editor = { getValue() { return originalCode; }}; /* eslint-enable no-unused-vars */ try {