Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created May 27, 2012 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raynos/c9a8d21c1f5b7a4f3acd to your computer and use it in GitHub Desktop.
Save Raynos/c9a8d21c1f5b7a4f3acd to your computer and use it in GitHub Desktop.
Using testling
var code =
"var suitestack = require('suitestack')\n" +
"\n" +
"reporter(suitestack)" +
"\n",
fakePath = path.join(__dirname, "./fake.js")
this.files.forEach(addToCode)
code += fs.readFileSync(path.join(__dirname, "../support/reporter.js"))
.toString()
fs.writeFileSync(fakePath, code)
var config = require(path.join(process.cwd(), program.testling))
config.files.push(fakePath)
var cmd = "tar -cf- " + config.files.join(" ") + " | curl -sSNT- " +
"-u " + config.auth + " testling.com/?main=" + fakePath +
"&browsers=" + config.browsers.join(",")
console.log("testling cmd", cmd)
var child = exec(cmd, function (err, stdout, stderr) {
})
child.stdout.pipe(process.stdout)
child.stderr.pipe(process.stderr)
function addToCode(fileName) {
var relative = path.relative(path.dirname(process.cwd()), fileName)
code += "require('" + relative + "')\n"
}
curl: (52) Empty reply from server
var code =
"var suitestack = require('suitestack')\n" +
"\n" +
"reporter(suitestack)" +
"\n",
fakePath = path.join(__dirname, "./fake.js")
this.files.forEach(addToCode)
code += fs.readFileSync(path.join(__dirname, "../support/reporter.js"))
.toString()
fs.writeFileSync(fakePath, code)
var config = require(path.join(process.cwd(), program.testling))
require("testling")({
entry: fakePath,
browsers: config.browsers
}).pipe(process.stdout)
function addToCode(fileName) {
var relative = path.relative(path.dirname(process.cwd()), fileName)
code += "require('" + relative + "')\n"
}
testling cmd tar -cf- test node_modules /home/raynos/Documents/suitestack-runner/bin/fake.js | curl -sSNT- -u raynos2@gmail.com:PASSWORD testling.com/?main=/home/raynos/Documents/suitestack-runner/bin/fake.js&browsers=firefox/10.0,chrome/17.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment