Add initial browser test suite using phantomjs for headless testing and jasmine

This commit is contained in:
Luke Page
2012-12-15 10:15:53 +00:00
parent ee4c0c8660
commit 6554117643
19 changed files with 3678 additions and 50 deletions

View File

@@ -0,0 +1,19 @@
var path = require('path'),
fs = require('fs'),
sys = require('util'),
output = '<html><head>\n';
fs.readdirSync(path.join('test/less/', '')).forEach(function (file) {
if (! /\.less/.test(file)) { return; }
var name = path.basename(file, '.less');
if (name === "javascript" || name === "urls") { return; }
output += '<link id="original-less:less-'+name+'" rel="stylesheet/less" type="text/css" href="http://localhost:8081/' + path.join('less', name) + '.less' +'">\n';
output += '<link id="expected-less:less-'+name+'" rel="stylesheet" type="text/css" href="http://localhost:8081/' + path.join('css', name) + '.css' + '">\n';
});
output += String(fs.readFileSync(path.join('test/browser', 'template.htm'))).replace("{runner-name}", "main");
fs.writeFileSync(path.join('test/browser', 'test-runner-main.htm'), output);