Skip to content

Commit 7f99fe0

Browse files
committed
bam
1 parent e873dc4 commit 7f99fe0

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

‎v5-unity/js/opt-frontend.ts‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,6 @@ class OptFrontendWithTestcases extends OptFrontend {
826826
var frontendOptionsObj = this.getBaseFrontendOptionsObj();
827827

828828
(backendOptionsObj as any).run_test_case = true; // just so we can see this in server logs
829-
(frontendOptionsObj as any).jumpToEnd = true;
830829

831830
var runTestCaseCallback = (dat) => {
832831
var trace = dat.trace;
@@ -885,7 +884,21 @@ class OptFrontendWithTestcases extends OptFrontend {
885884
runTestCaseCallback.bind(this));
886885
}
887886

888-
// TODO: add vizTestCase
887+
vizTestCase(id, codeToExec) {
888+
// adapted from executeCode in opt-frontend.js
889+
var backendOptionsObj = this.getBaseBackendOptionsObj();
890+
var frontendOptionsObj = this.getBaseFrontendOptionsObj();
891+
892+
(backendOptionsObj as any).viz_test_case = true; // just so we can see this in server logs
893+
//activateSyntaxErrorSurvey = false; // NASTY global! disable this survey when running test cases since it gets confusing
894+
(frontendOptionsObj as any).jumpToEnd = true;
895+
896+
this.executeCodeAndCreateViz(codeToExec,
897+
$('#pythonVersionSelector').val(),
898+
backendOptionsObj, frontendOptionsObj,
899+
'pyOutputPane');
900+
this.optTests.doneRunningTest(); // this will run before the callback in executeCodeAndCreateViz, but oh wells
901+
}
889902

890903
} // END Class OptFrontendWithTestcases
891904

0 commit comments

Comments
 (0)