mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Merge branch 'sauce'
This commit is contained in:
55
Gruntfile.js
55
Gruntfile.js
@@ -256,34 +256,33 @@ module.exports = function (grunt) {
|
||||
browserName: "firefox",
|
||||
version: '33',
|
||||
platform: 'Linux'
|
||||
}
|
||||
].concat(process.env.TRAVIS_BRANCH === "master" ? [] : [
|
||||
{
|
||||
browserName: "iPad",
|
||||
version: '8.0',
|
||||
platform: 'OS X 10.9',
|
||||
'device-orientation': 'portrait'
|
||||
},
|
||||
{
|
||||
browserName: "internet explorer",
|
||||
version: '8',
|
||||
platform: 'Windows XP'
|
||||
},
|
||||
{
|
||||
browserName: "internet explorer",
|
||||
version: '9',
|
||||
platform: 'Windows 7'
|
||||
},
|
||||
{
|
||||
browserName: "internet explorer",
|
||||
version: '10',
|
||||
platform: 'Windows 7'
|
||||
},
|
||||
{
|
||||
browserName: "internet explorer",
|
||||
version: '11',
|
||||
platform: 'Windows 8.1'
|
||||
}]),
|
||||
},
|
||||
{
|
||||
browserName: "iPad",
|
||||
version: '8.0',
|
||||
platform: 'OS X 10.9',
|
||||
'device-orientation': 'portrait'
|
||||
},
|
||||
{
|
||||
browserName: "internet explorer",
|
||||
version: '8',
|
||||
platform: 'Windows XP'
|
||||
},
|
||||
{
|
||||
browserName: "internet explorer",
|
||||
version: '9',
|
||||
platform: 'Windows 7'
|
||||
},
|
||||
{
|
||||
browserName: "internet explorer",
|
||||
version: '10',
|
||||
platform: 'Windows 7'
|
||||
},
|
||||
{
|
||||
browserName: "internet explorer",
|
||||
version: '11',
|
||||
platform: 'Windows 8.1'
|
||||
}],
|
||||
sauceConfig: {
|
||||
'record-video': process.env.TRAVIS_BRANCH !== "master",
|
||||
'record-screenshots': process.env.TRAVIS_BRANCH !== "master",
|
||||
|
||||
@@ -127,17 +127,20 @@ var testErrorSheet = function (sheet) {
|
||||
return actualErrorElement !== null;
|
||||
}).then(function () {
|
||||
var innerText = (actualErrorElement.innerHTML
|
||||
.replace(/<h3>|<\/?p>|<a href="[^"]*">|<\/a>|<ul>|<\/?pre( class="[^"]*")?>|<\/li>|<\/?label>/g, "")
|
||||
.replace(/<\/h3>/g, " ")
|
||||
.replace(/<li>|<\/ul>|<br>/g, "\n"))
|
||||
.replace(/&/g,"&");
|
||||
.replace(/<h3>|<\/?p>|<a href="[^"]*">|<\/a>|<ul>|<\/?pre( class="?[^">]*"?)?>|<\/li>|<\/?label>/ig, "")
|
||||
.replace(/<\/h3>/ig, " ")
|
||||
.replace(/<li>|<\/ul>|<br>/ig, "\n"))
|
||||
.replace(/&/ig,"&")
|
||||
// for IE8
|
||||
.replace(/\r\n/g,"\n")
|
||||
.replace(/\. \nin/,". in");
|
||||
actualErrorMsg = innerText
|
||||
.replace(/\n\d+/g, function (lineNo) {
|
||||
return lineNo + " ";
|
||||
})
|
||||
.replace(/\n\s*in /g, " in ")
|
||||
.replace("\n\n", "\n")
|
||||
.replace(/\nStack Trace\n[\s\S]*/, "")
|
||||
.replace(/\n{2,}/g, "\n")
|
||||
.replace(/\nStack Trace\n[\s\S]*/i, "")
|
||||
.replace(/\n$/, "");
|
||||
errorFile
|
||||
.then(function (errorTxt) {
|
||||
|
||||
@@ -9,6 +9,18 @@
|
||||
<script src="<%= script %>"></script>
|
||||
<% }); }; %>
|
||||
|
||||
<!-- generate script tags for tests -->
|
||||
<% var toArray = function(scripts) {
|
||||
%>[<%
|
||||
scripts.forEach(function(scriptUrl, index){
|
||||
%>"<%= scriptUrl %>"<%
|
||||
if (index !== scripts.length -1) {
|
||||
%>,<%
|
||||
}
|
||||
});
|
||||
%>]<%
|
||||
}; %>
|
||||
|
||||
<!-- for each test, generate CSS/LESS link tags -->
|
||||
<% scripts.src.forEach(function(fullLessName) {
|
||||
var pathParts = fullLessName.split('/');
|
||||
@@ -25,20 +37,49 @@
|
||||
<link rel="stylesheet" type="text/css" href="<%= style %>">
|
||||
<% }) %>
|
||||
|
||||
<!-- inital grunt-contrib-jasmine scripts -->
|
||||
<% generateScriptTags([].concat(scripts.polyfills, scripts.jasmine, scripts.boot)); %>
|
||||
<script>
|
||||
|
||||
<!-- Helpers - The less options -->
|
||||
<% generateScriptTags(scripts.helpers); %>
|
||||
function loadScript(url,callback){
|
||||
var script = document.createElement('script');
|
||||
|
||||
<!-- Vendor - less.js and common code -->
|
||||
<% generateScriptTags(scripts.vendor); %>
|
||||
if(document.documentMode === 8){
|
||||
script.onreadystatechange = function(){
|
||||
if (script.readyState === 'loaded'){
|
||||
if (callback){callback()};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
script.onload = function(){
|
||||
if (callback){callback()};
|
||||
};
|
||||
};
|
||||
script.src = url;
|
||||
document.body.appendChild(script);
|
||||
};
|
||||
|
||||
<!-- Spec -->
|
||||
<% generateScriptTags(scripts.specs); %>
|
||||
|
||||
<!-- final grunt-contrib-jasmine scripts -->
|
||||
<% generateScriptTags([].concat(scripts.reporters)); %>
|
||||
// allow sauce to query for the jasmine report
|
||||
window.jasmine = { getJSReport: function() { } };
|
||||
setTimeout(function() {
|
||||
var jasmine = <% toArray([].concat(scripts.polyfills, scripts.jasmine, scripts.boot)) %>,
|
||||
helpers = <% toArray(scripts.helpers) %>,
|
||||
vendor = <% toArray(scripts.vendor) %>,
|
||||
specs = <% toArray(scripts.specs) %>,
|
||||
reporters = <% toArray([].concat(scripts.reporters)) %>,
|
||||
allScripts = jasmine.concat(helpers).concat(vendor).concat(specs).concat(reporters);
|
||||
|
||||
function addNextScript() {
|
||||
if (allScripts.length) {
|
||||
var scriptSrc = allScripts.shift();
|
||||
loadScript(scriptSrc, addNextScript);
|
||||
} else {
|
||||
window.onload();
|
||||
}
|
||||
}
|
||||
addNextScript();
|
||||
|
||||
},1000);
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user