How do I run un-transpiled code on the simulator (or how do I transpile it)?


#1

I’m working with the headless simulator with an eye toward simulating games locally without communication with any CodeCombat server (even one running locally).

One of the things I’m working on is being able to edit and run arbitrary team code in the headless simulator.

Looking at the testing option in the headless simulator and the provided test.js file, this seems easy (provide the desired code in session.code), but no matter what code I provide it doesn’t seem to get run during the simulation. I filed a bug about this here.

I also looked at a simulation task downloaded from /queue/scoring but the response contains pre-transpiled code (session.transpiledCode as opposed to session.code) and I’m not sure how to transpile code myself.

Is there a way to provide untranspiled code to the simulator? If there’s no way to do that then what’s the easiest way to transpile code before sending it to the simulator?


#2

(We’ve been discussing on the issue itself.)