diff --git a/.eslintrc b/.eslintrc index 299b9d5b4..adaeef375 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,6 @@ { "env": { - "browser": true + "browser":true }, "globals": { "BOOMR":true, @@ -22,9 +22,10 @@ "no-console":0, "no-delete-var":0, "no-underscore-dangle":0, - "no-multi-spaces": 0, + "no-multi-spaces":0, "dot-notation":[2, {"allowKeywords": false}], - "space-unary-ops": 0, - "key-spacing": 0 + "space-unary-ops":0, + "key-spacing":0, + "no-empty":2 } } diff --git a/boomerang.js b/boomerang.js index f7f8d042d..33ee9ddb5 100644 --- a/boomerang.js +++ b/boomerang.js @@ -124,6 +124,7 @@ if (!BOOMR.plugins) { BOOMR.plugins = {}; } } } catch(ignore) { + // empty } try { @@ -138,6 +139,7 @@ if (!BOOMR.plugins) { BOOMR.plugins = {}; } } } catch(ignore) { + // empty } if (!createCustomEvent && d.createEventObject) { @@ -687,6 +689,7 @@ boomr = { try { form.submit(); } catch (ignore) { + // empty } if (urls.length) { @@ -866,7 +869,10 @@ boomr = { }; } } - catch(ignore) { } + catch(ignore) { + // empty + } + return Date.now || function() { return new Date().getTime(); }; }()), diff --git a/package.json b/package.json index 9bbbde2c5..ef6c3416b 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "grunt-contrib-connect": "^0.9.0", "grunt-contrib-copy": "^0.7.0", "grunt-contrib-uglify": "^0.6.0", - "grunt-eslint": "*", + "grunt-eslint": "^10.0.0", "grunt-filesize": "0.0.7", "grunt-karma": "^0.9.0", "grunt-protractor-runner": "^1.2.1", diff --git a/plugins/navtiming.js b/plugins/navtiming.js index 7804ffa18..9c0bf47be 100644 --- a/plugins/navtiming.js +++ b/plugins/navtiming.js @@ -88,7 +88,7 @@ var impl = { BOOMR.addVar(data); - try { impl.addedVars.push.apply(impl.addedVars, Object.keys(data)); } catch(ignore) {} + try { impl.addedVars.push.apply(impl.addedVars, Object.keys(data)); } catch(ignore) { /* empty */ } this.complete = true; BOOMR.sendBeacon(); @@ -142,7 +142,7 @@ var impl = { BOOMR.addVar(data); - try { impl.addedVars.push.apply(impl.addedVars, Object.keys(data)); } catch(ignore) {} + try { impl.addedVars.push.apply(impl.addedVars, Object.keys(data)); } catch(ignore) { /* empty */ } } // XXX Inconsistency warning. msFirstPaint above is in milliseconds while @@ -159,7 +159,7 @@ var impl = { BOOMR.addVar(data); - try { impl.addedVars.push.apply(impl.addedVars, Object.keys(data)); } catch(ignore) {} + try { impl.addedVars.push.apply(impl.addedVars, Object.keys(data)); } catch(ignore) { /* empty */ } } } diff --git a/plugins/page-params.js b/plugins/page-params.js index 4bafa0c15..d963a0f96 100644 --- a/plugins/page-params.js +++ b/plugins/page-params.js @@ -579,8 +579,7 @@ Handler.prototype = { return null; } } - catch(ignore) { - } + catch(ignore) { /* empty */ } BOOMR.addError(e, "PageVars.findResource"); return null; diff --git a/plugins/restiming.js b/plugins/restiming.js index 54ab89d40..d2246ba46 100644 --- a/plugins/restiming.js +++ b/plugins/restiming.js @@ -160,7 +160,7 @@ function getNavStartTime(frame) { } catch(e) { - // swallow all access exceptions + // empty } return navStart; diff --git a/tests/page-templates/04-page-params/01-page-group-order.html b/tests/page-templates/04-page-params/01-page-group-order.html new file mode 100644 index 000000000..809ed93bc --- /dev/null +++ b/tests/page-templates/04-page-params/01-page-group-order.html @@ -0,0 +1,38 @@ +<%= header %> +<%= boomerangSnippet %> +
+ + +<%= footer %> diff --git a/tests/page-templates/04-page-params/01-page-group-order.js b/tests/page-templates/04-page-params/01-page-group-order.js new file mode 100644 index 000000000..acf22473a --- /dev/null +++ b/tests/page-templates/04-page-params/01-page-group-order.js @@ -0,0 +1,16 @@ +/*eslint-env mocha*/ +/*global BOOMR_test,assert*/ + +describe("e2e/04-page-params/00-page-groups", function() { + var tf = BOOMR.plugins.TestFramework; + var t = BOOMR_test; + + it("Should pass basic beacon validation", function(done) { + t.validateBeaconWasSent(done); + }); + + it("Should set the Page Group to 111", function() { + var b = tf.lastBeacon(); + assert.equal(b["h.pg"], 111); + }); +});