code: function(filename, text) {
      // Rhino
      try {
        var out = new java.io.BufferedWriter(new java.io.FileWriter(filename));
        out.write(text);
        out.close();
        return;
      } catch (e) {}
      // PhantomJS, via a method injected by phantomjs-testrunner.js
      try {
        __phantom_writeFile(filename, text);
        return;
      } catch (f) {}
      // Node.js
      try {
        var fs = require('fs');
        var fd = fs.openSync(filename, 'w');
        fs.writeSync(fd, text, 0);
        fs.closeSync(fd);
        return;
      } catch (g) {}
    }
docs: writeFile from: https://github.com/larrymyers/jasmine-reporters