Uniter, Chai Webdriver, Gamedev.js Weekly

2014-01-24 00:00:00 +0000 by Alex R. Young


When we run our yearly survey, I've noticed PHP is popular with our readers. So here's something that you might either love, or consider arcane blasphemy: Uniter (GitHub: asmblah / uniter, License: MIT), a JavaScript to PHP source-to-source compiler:

Uniter allows you to execute PHP in the browser or in Node.js. As an on-the-fly recompiling interpreter (or transpiler) it results in the closest possible translation from PHP to native JavaScript code.

It includes Mocha unit tests and should run in IE 9 or above. It currently supports most of PHP's keywords, and even has basic class support. The demo is interactive, so you can try editing the PHP source to see what happens.

Chai Webdriver

Chai Webdriver (GitHub: goodeggs / chai-webdriver, License: MIT, npm: chai-webdriver) by Max Edmands is a Chai plugin for making markup-based assertions when using webdriver. For example:

// Start with a webdriver instance:
var sw = require('selenium-webdriver');
var driver = new sw.Builder()

// And then...
var chai = require('chai');
var chaiWebdriver = require('chai-webdriver');
chai.use chaiWebdriver(driver);

// And you're good to go!
chai.expect('#site-container h1.heading').dom.to.not.contain.text("I'm a kitty!");

It works with Selenium, chromedriver, PhantomJS, and SauceLabs.

Gamedev.js Weekly

Gamedev.js Weekly is a weekly newsletter of JavaScript game-related news. There's an archive so you can preview it before signing up.