Testing Inform with node.js and Quixe

This is still in progress but I’m working on using Quixe for testing Inform 6 games and libraries. node.js testing frameworks are quite advanced, don’t depend on upstream library version so transcript comparison won’t fail on different systems just from a version mismatch and there’s nothing to build after installing dependencies.

I’m having two problems, though. Problem 1 is that Quixe is not a node.js library, it’s packaged as an old dirty hack using the global object as a pseudo-browser tab. So when one game ends, Quixe still sees a closed Glk VM and refuses to run another.

Problem 2 is the API: output_callback and input_callback run only on the direct output, so they can’t detect text in the room changes.

Still, it’s already useful for short responses. Sample that works:

1 Like

Quixe isn’t a node library, but I had to make it work with node libraries for Lectrote. The current init code should allow you to create a new Quixe object (call new QuixeClass()) with a new Glk interface and run that from scratch.

As for the I/O, you want to keep Quixe and GlkAPI, but replace GlkOte with a headless testing layer. Then do all your tests on the message stream defined in GlkOte: a Javascript library for IF interfaces . This has worked very well for my usual testing setup, which is remglk and regtest.py.

(Quixe plus GlkAPI plus a headless testing layer should work the same as a C interpreter plus RemGlk. Just in JS rather than C.)

1 Like

Do you have particular needs that can only be met by Node, or are you really just wanting a reliable test framework?

Because regtest.py is the go-to reliable test framework. And you can run it with the Emglken interpreters in RemGlk mode if you need to test multi-window situations.

My Python is not strong enough to make regtest.py work. I’m testing RInform games, so Glk returns lines as buffers -B>B 3;03>; =5?>=OB5=. instead of Unicode.

Are you using Cheapglk? You have to pass the -u option to enable Unicode output.

Hmm. Thank you @Dannii! I didn’t know about regtest.py and it’s easier to adapt than nodejs. The only problem are the restart/quit verbs but that’s nothing.

1 Like