__filename points to the RunKit “runtime” (all the code that makes multiple cells work, write outputs, etc) which lives at app/index.js.
I imagine what you want is your notebook code? Because of the REPL nature of our notebooks, your notebook code does not live on disk, it’s fed into our runtime cell by cell.
Thank you for replying! It’s great to know how that works, yet it’s somewhat unfulfilling to see the actual solution, as it doesn’t make for the greatest user-experience to write a test suite inside of a string. When I made mini-mocha it had the right UX, as it made it possible to copy-paste existing mocha test suites and make them run without changes in RunKit (at least the 90% most used subset of Mocha).
Unfortunately, mini-mocha re-implements a lot of the machinery, which is a bit of a drag, considering it’s possible to start Mocha from inside of Node (as run-in-mocha does), so I thought I’d give it a go. Oh, well. I guess I can’t have my cake and eat it too