mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-25 18:06:15 -04:00
formatting: bulk remove trailing whitespaces on frontend tests
This is a followup on 312c72c364
, which did the same on the main code base,
and is preliminary work for tidying up John's changes in the following commits.
No functional changes.
Command:
find tests/frontend -name '*.js' -type f -print0 | xargs -0 sed --in-place 's/[[:space:]]*$//'
This commit is contained in:
parent
61f0b5db0b
commit
04e9fc3a2f
25 changed files with 152 additions and 152 deletions
|
@ -65,7 +65,7 @@
|
|||
|
||||
var name = $flags[i]
|
||||
, assertion = new Assertion(this.obj, name, this)
|
||||
|
||||
|
||||
if ('function' == typeof Assertion.prototype[name]) {
|
||||
// clone the function, make sure we dont touch the prot reference
|
||||
var old = this[name];
|
||||
|
@ -148,7 +148,7 @@
|
|||
if ('object' == typeof fn && not) {
|
||||
// in the presence of a matcher, ensure the `not` only applies to
|
||||
// the matching.
|
||||
this.flags.not = false;
|
||||
this.flags.not = false;
|
||||
}
|
||||
|
||||
var name = this.obj.name || 'fn';
|
||||
|
@ -219,7 +219,7 @@
|
|||
};
|
||||
|
||||
/**
|
||||
* Assert within start to finish (inclusive).
|
||||
* Assert within start to finish (inclusive).
|
||||
*
|
||||
* @param {Number} start
|
||||
* @param {Number} finish
|
||||
|
@ -298,7 +298,7 @@
|
|||
, function(){ return 'expected ' + i(this.obj) + ' to be above ' + n });
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Assert string value matches _regexp_.
|
||||
*
|
||||
|
@ -359,13 +359,13 @@
|
|||
} catch (e) {
|
||||
hasProp = undefined !== this.obj[name]
|
||||
}
|
||||
|
||||
|
||||
this.assert(
|
||||
hasProp
|
||||
, function(){ return 'expected ' + i(this.obj) + ' to have a property ' + i(name) }
|
||||
, function(){ return 'expected ' + i(this.obj) + ' to not have a property ' + i(name) });
|
||||
}
|
||||
|
||||
|
||||
if (undefined !== val) {
|
||||
this.assert(
|
||||
val === this.obj[name]
|
||||
|
@ -537,7 +537,7 @@
|
|||
return html;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Returns true if object is a DOM element.
|
||||
var isDOMElement = function (object) {
|
||||
if (typeof HTMLElement === 'object') {
|
||||
|
@ -843,9 +843,9 @@
|
|||
|
||||
expect.eql = function eql (actual, expected) {
|
||||
// 7.1. All identical values are equivalent, as determined by ===.
|
||||
if (actual === expected) {
|
||||
if (actual === expected) {
|
||||
return true;
|
||||
} else if ('undefined' != typeof Buffer
|
||||
} else if ('undefined' != typeof Buffer
|
||||
&& Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) {
|
||||
if (actual.length != expected.length) return false;
|
||||
|
||||
|
|
|
@ -32,11 +32,11 @@ require.register = function (path, fn){
|
|||
require.relative = function (parent) {
|
||||
return function(p){
|
||||
if ('.' != p.charAt(0)) return require(p);
|
||||
|
||||
|
||||
var path = parent.split('/')
|
||||
, segs = p.split('/');
|
||||
path.pop();
|
||||
|
||||
|
||||
for (var i = 0; i < segs.length; i++) {
|
||||
var seg = segs[i];
|
||||
if ('..' == seg) path.pop();
|
||||
|
@ -52,7 +52,7 @@ require.register("browser/debug.js", function(module, exports, require){
|
|||
|
||||
module.exports = function(type){
|
||||
return function(){
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
}); // module: browser/debug.js
|
||||
|
@ -530,7 +530,7 @@ var Suite = require('../suite')
|
|||
|
||||
/**
|
||||
* BDD-style interface:
|
||||
*
|
||||
*
|
||||
* describe('Array', function(){
|
||||
* describe('#indexOf()', function(){
|
||||
* it('should return -1 when not present', function(){
|
||||
|
@ -542,7 +542,7 @@ var Suite = require('../suite')
|
|||
* });
|
||||
* });
|
||||
* });
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
module.exports = function(suite){
|
||||
|
@ -587,7 +587,7 @@ module.exports = function(suite){
|
|||
* and callback `fn` containing nested suites
|
||||
* and/or tests.
|
||||
*/
|
||||
|
||||
|
||||
context.describe = context.context = function(title, fn){
|
||||
var suite = Suite.create(suites[0], title);
|
||||
suites.unshift(suite);
|
||||
|
@ -667,19 +667,19 @@ var Suite = require('../suite')
|
|||
|
||||
/**
|
||||
* TDD-style interface:
|
||||
*
|
||||
*
|
||||
* exports.Array = {
|
||||
* '#indexOf()': {
|
||||
* 'should return -1 when the value is not present': function(){
|
||||
*
|
||||
*
|
||||
* },
|
||||
*
|
||||
* 'should return the correct index when the value is present': function(){
|
||||
*
|
||||
*
|
||||
* }
|
||||
* }
|
||||
* };
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
module.exports = function(suite){
|
||||
|
@ -739,27 +739,27 @@ var Suite = require('../suite')
|
|||
|
||||
/**
|
||||
* QUnit-style interface:
|
||||
*
|
||||
*
|
||||
* suite('Array');
|
||||
*
|
||||
*
|
||||
* test('#length', function(){
|
||||
* var arr = [1,2,3];
|
||||
* ok(arr.length == 3);
|
||||
* });
|
||||
*
|
||||
*
|
||||
* test('#indexOf()', function(){
|
||||
* var arr = [1,2,3];
|
||||
* ok(arr.indexOf(1) == 0);
|
||||
* ok(arr.indexOf(2) == 1);
|
||||
* ok(arr.indexOf(3) == 2);
|
||||
* });
|
||||
*
|
||||
*
|
||||
* suite('String');
|
||||
*
|
||||
*
|
||||
* test('#length', function(){
|
||||
* ok('foo'.length == 3);
|
||||
* });
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
module.exports = function(suite){
|
||||
|
@ -802,7 +802,7 @@ module.exports = function(suite){
|
|||
/**
|
||||
* Describe a "suite" with the given `title`.
|
||||
*/
|
||||
|
||||
|
||||
context.suite = function(title){
|
||||
if (suites.length > 1) suites.shift();
|
||||
var suite = Suite.create(suites[0], title);
|
||||
|
@ -840,7 +840,7 @@ var Suite = require('../suite')
|
|||
* suiteSetup(function(){
|
||||
*
|
||||
* });
|
||||
*
|
||||
*
|
||||
* test('should return -1 when not present', function(){
|
||||
*
|
||||
* });
|
||||
|
@ -2689,7 +2689,7 @@ exports = module.exports = Min;
|
|||
|
||||
function Min(runner) {
|
||||
Base.call(this, runner);
|
||||
|
||||
|
||||
runner.on('start', function(){
|
||||
// clear screen
|
||||
process.stdout.write('\u001b[2J');
|
||||
|
@ -3337,7 +3337,7 @@ function XUnit(runner) {
|
|||
runner.on('pass', function(test){
|
||||
tests.push(test);
|
||||
});
|
||||
|
||||
|
||||
runner.on('fail', function(test){
|
||||
tests.push(test);
|
||||
});
|
||||
|
@ -3354,7 +3354,7 @@ function XUnit(runner) {
|
|||
}, false));
|
||||
|
||||
tests.forEach(test);
|
||||
console.log('</testsuite>');
|
||||
console.log('</testsuite>');
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -3615,7 +3615,7 @@ Runnable.prototype.run = function(fn){
|
|||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// sync
|
||||
try {
|
||||
if (!this.pending) this.fn.call(ctx);
|
||||
|
@ -4536,7 +4536,7 @@ exports.indexOf = function(arr, obj, start){
|
|||
|
||||
/**
|
||||
* Array#reduce (<=IE8)
|
||||
*
|
||||
*
|
||||
* @param {Array} array
|
||||
* @param {Function} fn
|
||||
* @param {Object} initial value
|
||||
|
|
|
@ -305,11 +305,11 @@ var START_TO_END = 1;
|
|||
var END_TO_END = 2;
|
||||
var END_TO_START = 3;
|
||||
// from the Mozilla documentation, for range.compareBoundaryPoints(how, sourceRange)
|
||||
// -1, 0, or 1, indicating whether the corresponding boundary-point of range is respectively before, equal to, or after the corresponding boundary-point of sourceRange.
|
||||
// -1, 0, or 1, indicating whether the corresponding boundary-point of range is respectively before, equal to, or after the corresponding boundary-point of sourceRange.
|
||||
// * Range.END_TO_END compares the end boundary-point of sourceRange to the end boundary-point of range.
|
||||
// * Range.END_TO_START compares the end boundary-point of sourceRange to the start boundary-point of range.
|
||||
// * Range.START_TO_END compares the start boundary-point of sourceRange to the end boundary-point of range.
|
||||
// * Range.START_TO_START compares the start boundary-point of sourceRange to the start boundary-point of range.
|
||||
// * Range.START_TO_START compares the start boundary-point of sourceRange to the start boundary-point of range.
|
||||
function w3cstart(rng, constraint){
|
||||
if (rng.compareBoundaryPoints (START_TO_START, constraint) <= 0) return 0; // at or before the beginning
|
||||
if (rng.compareBoundaryPoints (END_TO_START, constraint) >= 0) return constraint.toString().length;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue