[Pkg-javascript-commits] [less.js] 260/285: tidy up and fix ff/ie11

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:24:00 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.0.0
in repository less.js.

commit 77dbc98321c506eb7111f21c5024050abd303ea9
Author: Luke Page <luke.a.page at gmail.com>
Date:   Sun Nov 2 12:27:40 2014 +0000

    tidy up and fix ff/ie11
---
 test/browser/common.js | 28 ++++++++--------------------
 1 file changed, 8 insertions(+), 20 deletions(-)

diff --git a/test/browser/common.js b/test/browser/common.js
index 27f6c3e..386da79 100644
--- a/test/browser/common.js
+++ b/test/browser/common.js
@@ -112,20 +112,6 @@ var waitFor = function (waitFunc) {
     });
 };
 
-function getInnerText(el) {
-    var text = "";
-    if (typeof window.getSelection != "undefined") {
-        var sel = window.getSelection();
-        sel.removeAllRanges();
-        var range = document.createRange();
-        range.selectNodeContents(el);
-        sel.addRange(range);
-        text = sel.toString();
-        sel.removeAllRanges();
-    }
-    return text;
-}
-
 var testErrorSheet = function (sheet) {
     it(sheet.id + " should match an error", function (done) {
         var lessHref = sheet.href,
@@ -140,25 +126,27 @@ var testErrorSheet = function (sheet) {
             actualErrorElement = document.getElementById(id);
             return actualErrorElement !== null;
         }).then(function () {
-                var innerText = actualErrorElement.innerText ||
-                    (actualErrorElement.innerHTML
-                        .replace(/<h3>|<\/?p>|<a href="[^"]*">|<\/a>|<ul>|<pre class="[^"]*">|<\/pre>|<\/li>|<\/?label>/g, "")
+                var innerText = (actualErrorElement.innerHTML
+                        .replace(/<h3>|<\/?p>|<a href="[^"]*">|<\/a>|<ul>|<\/?pre( class="[^"]*")?>|<\/li>|<\/?label>/g, "")
                         .replace(/<\/h3>/g, " ")
-                        .replace(/<li>|<\/ul>/g, "\n"));
+                        .replace(/<li>|<\/ul>|<br>/g, "\n"))
+                        .replace(/&/g,"&");
                 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(/\nStack Trace\n[\s\S]*/, "")
+                    .replace(/\n$/, "");
                 errorFile
                     .then(function (errorTxt) {
                         errorTxt = errorTxt
                             .replace("{path}", "")
                             .replace("{pathrel}", "")
                             .replace("{pathhref}", "http://localhost:8081/test/less/errors/")
-                            .replace("{404status}", " (404)");
+                            .replace("{404status}", " (404)")
+                            .replace(/\n$/, "");
                         expect(actualErrorMsg).toEqual(errorTxt);
                         if (errorTxt == actualErrorMsg) {
                             actualErrorElement.style.display = "none";

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list