implement log to console and fix browser tests

This commit is contained in:
Luke Page
2013-08-21 19:35:28 +01:00
parent c1fe375cdc
commit 6c5072ebbc
7 changed files with 95 additions and 12 deletions

View File

@@ -17,8 +17,8 @@ var createTestRunnerPage = function(dir, exclude, testSuiteName, dir2) {
if (exclude && name.match(exclude)) { return; }
output += '<link id="original-less:' + id + '" rel="stylesheet/less" type="text/css" href="/' + path.join(dir, 'less', dir2 || "", name) + '.less' +'">\n';
output += '<link id="expected-less:' + id + '" rel="stylesheet" type="text/css" href="/' + path.join(dir, 'css', dir2 || "", name) + '.css' + '">\n';
output += '<link id="original-less:' + id + '" rel="stylesheet/less" type="text/css" href="/' + path.join(dir, 'less', dir2 || "", name).replace("\\", "/") + '.less' +'" />\n';
output += '<link id="expected-less:' + id + '" rel="stylesheet" type="text/css" href="/' + path.join(dir, 'css', dir2 || "", name).replace("\\", "/") + '.css' + '" />\n';
});
output += String(fs.readFileSync(path.join('test/browser', 'template.htm'))).replace("{runner-name}", testSuiteName);

View File

@@ -1,5 +1,4 @@
@import "http://localhost:8081/browser/less/imports/modify-this.css";
@import "http://localhost:8081/browser/less/imports/modify-again.css";
.modify {
my-url: url("http://localhost:8081/browser/less/imports/a.png");

View File

@@ -1,5 +1,4 @@
@import "https://www.github.com/modify-this.css";
@import "https://www.github.com/modify-again.css";
.modify {
my-url: url("https://www.github.com/a.png");

27
test/browser/es5.js Normal file
View File

@@ -0,0 +1,27 @@
/*
PhantomJS does not implement bind. this is from
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
*/
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function () {},
fBound = function () {
return fToBind.apply(this instanceof fNOP && oThis
? this
: oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
fNOP.prototype = this.prototype;
fBound.prototype = new fNOP();
return fBound;
};
}

View File

@@ -1,9 +1,10 @@
<script src="/browser/jasmine.js" type="text/javascript"></script>
<script src="/browser/jasmine-html.js" type="text/javascript"></script>
<script src="/browser/common.js" type="text/javascript"></script>
<script src="/browser/es5.js" type="text/javascript"></script>
<script src="/browser/runner-{runner-name}.js" type="text/javascript"></script>
<script src="/browser/less.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/browser/jasmine.css"></link>
<link rel="stylesheet" type="text/css" href="/browser/jasmine.css" />
</head>
<body>
</body>