From 4859684c97f836c9c510e6dfa327d66e18877463 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 4 Jan 2021 03:56:00 +0200 Subject: [PATCH] Prefer Jest's toBe true/false matcher. (#1639) Also, remove some trailing spaces from descriptions. --- test/api/attributes.js | 170 +++++++++++----------- test/api/manipulation.js | 306 +++++++++++++++++++-------------------- test/api/traversing.js | 12 +- 3 files changed, 244 insertions(+), 244 deletions(-) diff --git a/test/api/attributes.js b/test/api/attributes.js index 345a8df933..3d5176e22a 100644 --- a/test/api/attributes.js +++ b/test/api/attributes.js @@ -283,7 +283,7 @@ describe('$(...)', function () { expect(Object.keys(data)).toHaveLength(0); }); - it('(invalid key) : invalid data attribute should return `undefined` ', function () { + it('(invalid key) : invalid data attribute should return `undefined`', function () { var data = $('.frey').data('lol'); expect(data).toBe(undefined); }); @@ -545,37 +545,37 @@ describe('$(...)', function () { it('(valid class) : should return true', function () { var cls = $('.apple').hasClass('apple'); - expect(cls).toBeTruthy(); + expect(cls).toBe(true); - expect(test('foo').hasClass('foo')).toBeTruthy(); - expect(test('foo bar').hasClass('foo')).toBeTruthy(); - expect(test('bar foo').hasClass('foo')).toBeTruthy(); - expect(test('bar foo bar').hasClass('foo')).toBeTruthy(); + expect(test('foo').hasClass('foo')).toBe(true); + expect(test('foo bar').hasClass('foo')).toBe(true); + expect(test('bar foo').hasClass('foo')).toBe(true); + expect(test('bar foo bar').hasClass('foo')).toBe(true); }); it('(invalid class) : should return false', function () { var cls = $('#fruits').hasClass('fruits'); - expect(cls).toBeFalsy(); - expect(test('foo-bar').hasClass('foo')).toBeFalsy(); - expect(test('foo-bar').hasClass('foo')).toBeFalsy(); - expect(test('foo-bar').hasClass('foo-ba')).toBeFalsy(); + expect(cls).toBe(false); + expect(test('foo-bar').hasClass('foo')).toBe(false); + expect(test('foo-bar').hasClass('foo')).toBe(false); + expect(test('foo-bar').hasClass('foo-ba')).toBe(false); }); it('should check multiple classes', function () { // Add a class $('.apple').addClass('red'); - expect($('.apple').hasClass('apple')).toBeTruthy(); - expect($('.apple').hasClass('red')).toBeTruthy(); + expect($('.apple').hasClass('apple')).toBe(true); + expect($('.apple').hasClass('red')).toBe(true); // Remove one and test again $('.apple').removeClass('apple'); - expect($('li').eq(0).hasClass('apple')).toBeFalsy(); + expect($('li').eq(0).hasClass('apple')).toBe(false); }); it('(empty string argument) : should return false', function () { - expect(test('foo').hasClass('')).toBeFalsy(); - expect(test('foo bar').hasClass('')).toBeFalsy(); - expect(test('foo bar').removeClass('foo').hasClass('')).toBeFalsy(); + expect(test('foo').hasClass('')).toBe(false); + expect(test('foo bar').hasClass('')).toBe(false); + expect(test('foo bar').removeClass('foo').hasClass('')).toBe(false); }); }); @@ -584,28 +584,28 @@ describe('$(...)', function () { var $fruits = $('#fruits'); $fruits.addClass('fruits'); var cls = $fruits.hasClass('fruits'); - expect(cls).toBeTruthy(); + expect(cls).toBe(true); }); it('(single class) : should add the class to the element', function () { $('.apple').addClass('fruit'); var cls = $('.apple').hasClass('fruit'); - expect(cls).toBeTruthy(); + expect(cls).toBe(true); }); it('(class): adds classes to many selected items', function () { $('li').addClass('fruit'); - expect($('.apple').hasClass('fruit')).toBeTruthy(); - expect($('.orange').hasClass('fruit')).toBeTruthy(); - expect($('.pear').hasClass('fruit')).toBeTruthy(); + expect($('.apple').hasClass('fruit')).toBe(true); + expect($('.orange').hasClass('fruit')).toBe(true); + expect($('.pear').hasClass('fruit')).toBe(true); }); it('(class class class) : should add multiple classes to the element', function () { $('.apple').addClass('fruit red tasty'); - expect($('.apple').hasClass('apple')).toBeTruthy(); - expect($('.apple').hasClass('fruit')).toBeTruthy(); - expect($('.apple').hasClass('red')).toBeTruthy(); - expect($('.apple').hasClass('tasty')).toBeTruthy(); + expect($('.apple').hasClass('apple')).toBe(true); + expect($('.apple').hasClass('fruit')).toBe(true); + expect($('.apple').hasClass('red')).toBe(true); + expect($('.apple').hasClass('tasty')).toBe(true); }); it('(fn) : should add classes returned from the function', function () { @@ -626,10 +626,10 @@ describe('$(...)', function () { [2, 'pear'], ]); expect(thisVals).toStrictEqual([$fruits[0], $fruits[1], $fruits[2]]); - expect($fruits.eq(0).hasClass('apple')).toBeTruthy(); - expect($fruits.eq(0).hasClass('red')).toBeTruthy(); - expect($fruits.eq(1).hasClass('orange')).toBeTruthy(); - expect($fruits.eq(2).hasClass('pear')).toBeTruthy(); + expect($fruits.eq(0).hasClass('apple')).toBe(true); + expect($fruits.eq(0).hasClass('red')).toBe(true); + expect($fruits.eq(1).hasClass('orange')).toBe(true); + expect($fruits.eq(2).hasClass('pear')).toBe(true); }); }); @@ -648,7 +648,7 @@ describe('$(...)', function () { it('(invalid class) : should not remove anything', function () { $('.pear').removeClass('fruit'); - expect($('.pear').hasClass('pear')).toBeTruthy(); + expect($('.pear').hasClass('pear')).toBe(true); }); it('(no class attribute) : should not throw an exception', function () { @@ -661,36 +661,36 @@ describe('$(...)', function () { it('(single class) : should remove a single class from the element', function () { $('.pear').addClass('fruit'); - expect($('.pear').hasClass('fruit')).toBeTruthy(); + expect($('.pear').hasClass('fruit')).toBe(true); $('.pear').removeClass('fruit'); - expect($('.pear').hasClass('fruit')).toBeFalsy(); - expect($('.pear').hasClass('pear')).toBeTruthy(); + expect($('.pear').hasClass('fruit')).toBe(false); + expect($('.pear').hasClass('pear')).toBe(true); }); it('(single class) : should remove a single class from multiple classes on the element', function () { $('.pear').addClass('fruit green tasty'); - expect($('.pear').hasClass('fruit')).toBeTruthy(); - expect($('.pear').hasClass('green')).toBeTruthy(); - expect($('.pear').hasClass('tasty')).toBeTruthy(); + expect($('.pear').hasClass('fruit')).toBe(true); + expect($('.pear').hasClass('green')).toBe(true); + expect($('.pear').hasClass('tasty')).toBe(true); $('.pear').removeClass('green'); - expect($('.pear').hasClass('fruit')).toBeTruthy(); - expect($('.pear').hasClass('green')).toBeFalsy(); - expect($('.pear').hasClass('tasty')).toBeTruthy(); + expect($('.pear').hasClass('fruit')).toBe(true); + expect($('.pear').hasClass('green')).toBe(false); + expect($('.pear').hasClass('tasty')).toBe(true); }); it('(class class class) : should remove multiple classes from the element', function () { $('.apple').addClass('fruit red tasty'); - expect($('.apple').hasClass('apple')).toBeTruthy(); - expect($('.apple').hasClass('fruit')).toBeTruthy(); - expect($('.apple').hasClass('red')).toBeTruthy(); - expect($('.apple').hasClass('tasty')).toBeTruthy(); + expect($('.apple').hasClass('apple')).toBe(true); + expect($('.apple').hasClass('fruit')).toBe(true); + expect($('.apple').hasClass('red')).toBe(true); + expect($('.apple').hasClass('tasty')).toBe(true); $('.apple').removeClass('apple red tasty'); - expect($('.fruit').hasClass('apple')).toBeFalsy(); - expect($('.fruit').hasClass('red')).toBeFalsy(); - expect($('.fruit').hasClass('tasty')).toBeFalsy(); - expect($('.fruit').hasClass('fruit')).toBeTruthy(); + expect($('.fruit').hasClass('apple')).toBe(false); + expect($('.fruit').hasClass('red')).toBe(false); + expect($('.fruit').hasClass('tasty')).toBe(false); + expect($('.fruit').hasClass('fruit')).toBe(true); }); it('(class) : should remove all occurrences of a class name', function () { @@ -716,10 +716,10 @@ describe('$(...)', function () { [2, 'pear'], ]); expect(thisVals).toStrictEqual([$fruits[0], $fruits[1], $fruits[2]]); - expect($fruits.eq(0).hasClass('apple')).toBeFalsy(); - expect($fruits.eq(0).hasClass('red')).toBeFalsy(); - expect($fruits.eq(1).hasClass('orange')).toBeTruthy(); - expect($fruits.eq(2).hasClass('pear')).toBeTruthy(); + expect($fruits.eq(0).hasClass('apple')).toBe(false); + expect($fruits.eq(0).hasClass('red')).toBe(false); + expect($fruits.eq(1).hasClass('orange')).toBe(true); + expect($fruits.eq(2).hasClass('pear')).toBe(true); }); it('(fn) : should no op elements without attributes', function () { @@ -734,26 +734,26 @@ describe('$(...)', function () { describe('.toggleClass', function () { it('(class class) : should toggle multiple classes from the element', function () { $('.apple').addClass('fruit'); - expect($('.apple').hasClass('apple')).toBeTruthy(); - expect($('.apple').hasClass('fruit')).toBeTruthy(); - expect($('.apple').hasClass('red')).toBeFalsy(); + expect($('.apple').hasClass('apple')).toBe(true); + expect($('.apple').hasClass('fruit')).toBe(true); + expect($('.apple').hasClass('red')).toBe(false); $('.apple').toggleClass('apple red'); - expect($('.fruit').hasClass('apple')).toBeFalsy(); - expect($('.fruit').hasClass('red')).toBeTruthy(); - expect($('.fruit').hasClass('fruit')).toBeTruthy(); + expect($('.fruit').hasClass('apple')).toBe(false); + expect($('.fruit').hasClass('red')).toBe(true); + expect($('.fruit').hasClass('fruit')).toBe(true); }); it('(class class, true) : should add multiple classes to the element', function () { $('.apple').addClass('fruit'); - expect($('.apple').hasClass('apple')).toBeTruthy(); - expect($('.apple').hasClass('fruit')).toBeTruthy(); - expect($('.apple').hasClass('red')).toBeFalsy(); + expect($('.apple').hasClass('apple')).toBe(true); + expect($('.apple').hasClass('fruit')).toBe(true); + expect($('.apple').hasClass('red')).toBe(false); $('.apple').toggleClass('apple red', true); - expect($('.fruit').hasClass('apple')).toBeTruthy(); - expect($('.fruit').hasClass('red')).toBeTruthy(); - expect($('.fruit').hasClass('fruit')).toBeTruthy(); + expect($('.fruit').hasClass('apple')).toBe(true); + expect($('.fruit').hasClass('red')).toBe(true); + expect($('.fruit').hasClass('fruit')).toBe(true); }); it('(class true) : should add only one instance of class', function () { @@ -764,14 +764,14 @@ describe('$(...)', function () { it('(class class, false) : should remove multiple classes from the element', function () { $('.apple').addClass('fruit'); - expect($('.apple').hasClass('apple')).toBeTruthy(); - expect($('.apple').hasClass('fruit')).toBeTruthy(); - expect($('.apple').hasClass('red')).toBeFalsy(); + expect($('.apple').hasClass('apple')).toBe(true); + expect($('.apple').hasClass('fruit')).toBe(true); + expect($('.apple').hasClass('red')).toBe(false); $('.apple').toggleClass('apple red', false); - expect($('.fruit').hasClass('apple')).toBeFalsy(); - expect($('.fruit').hasClass('red')).toBeFalsy(); - expect($('.fruit').hasClass('fruit')).toBeTruthy(); + expect($('.fruit').hasClass('apple')).toBe(false); + expect($('.fruit').hasClass('red')).toBe(false); + expect($('.fruit').hasClass('fruit')).toBe(true); }); it('(fn) : should toggle classes returned from the function', function () { @@ -779,26 +779,26 @@ describe('$(...)', function () { $('.apple').addClass('fruit'); $('.carrot').addClass('vegetable'); - expect($('.apple').hasClass('fruit')).toBeTruthy(); - expect($('.apple').hasClass('vegetable')).toBeFalsy(); - expect($('.orange').hasClass('fruit')).toBeFalsy(); - expect($('.orange').hasClass('vegetable')).toBeFalsy(); - expect($('.carrot').hasClass('fruit')).toBeFalsy(); - expect($('.carrot').hasClass('vegetable')).toBeTruthy(); - expect($('.sweetcorn').hasClass('fruit')).toBeFalsy(); - expect($('.sweetcorn').hasClass('vegetable')).toBeFalsy(); + expect($('.apple').hasClass('fruit')).toBe(true); + expect($('.apple').hasClass('vegetable')).toBe(false); + expect($('.orange').hasClass('fruit')).toBe(false); + expect($('.orange').hasClass('vegetable')).toBe(false); + expect($('.carrot').hasClass('fruit')).toBe(false); + expect($('.carrot').hasClass('vegetable')).toBe(true); + expect($('.sweetcorn').hasClass('fruit')).toBe(false); + expect($('.sweetcorn').hasClass('vegetable')).toBe(false); $('li').toggleClass(function () { return $(this).parent().is('#fruits') ? 'fruit' : 'vegetable'; }); - expect($('.apple').hasClass('fruit')).toBeFalsy(); - expect($('.apple').hasClass('vegetable')).toBeFalsy(); - expect($('.orange').hasClass('fruit')).toBeTruthy(); - expect($('.orange').hasClass('vegetable')).toBeFalsy(); - expect($('.carrot').hasClass('fruit')).toBeFalsy(); - expect($('.carrot').hasClass('vegetable')).toBeFalsy(); - expect($('.sweetcorn').hasClass('fruit')).toBeFalsy(); - expect($('.sweetcorn').hasClass('vegetable')).toBeTruthy(); + expect($('.apple').hasClass('fruit')).toBe(false); + expect($('.apple').hasClass('vegetable')).toBe(false); + expect($('.orange').hasClass('fruit')).toBe(true); + expect($('.orange').hasClass('vegetable')).toBe(false); + expect($('.carrot').hasClass('fruit')).toBe(false); + expect($('.carrot').hasClass('vegetable')).toBe(false); + expect($('.sweetcorn').hasClass('fruit')).toBe(false); + expect($('.sweetcorn').hasClass('vegetable')).toBe(true); }); it('(fn) : should work with no initial class attribute', function () { diff --git a/test/api/manipulation.js b/test/api/manipulation.js index e45a2a0fe3..6cd832deae 100644 --- a/test/api/manipulation.js +++ b/test/api/manipulation.js @@ -16,9 +16,9 @@ describe('$(...)', function () { var $redFruits = $('
'); $('.apple').wrap($redFruits); - expect($fruits.children().eq(0).hasClass('red-fruits')).toBeTruthy(); - expect($('.red-fruits').children().eq(0).hasClass('apple')).toBeTruthy(); - expect($fruits.children().eq(1).hasClass('orange')).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('red-fruits')).toBe(true); + expect($('.red-fruits').children().eq(0).hasClass('apple')).toBe(true); + expect($fruits.children().eq(1).hasClass('orange')).toBe(true); expect($redFruits.children()).toHaveLength(1); }); @@ -39,9 +39,9 @@ describe('$(...)', function () { it('(html) : should insert the markup and add selected element(s) as its child', function () { $('.apple').wrap('
'); - expect($fruits.children().eq(0).hasClass('red-fruits')).toBeTruthy(); - expect($('.red-fruits').children().eq(0).hasClass('apple')).toBeTruthy(); - expect($fruits.children().eq(1).hasClass('orange')).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('red-fruits')).toBe(true); + expect($('.red-fruits').children().eq(0).hasClass('apple')).toBe(true); + expect($fruits.children().eq(1).hasClass('orange')).toBe(true); expect($('.red-fruits').children()).toHaveLength(1); }); @@ -57,11 +57,11 @@ describe('$(...)', function () { ); $('.orange').wrap($orangeFruits); - expect($fruits.children().eq(1).hasClass('orange-fruits')).toBeTruthy(); - expect( - $('.orange-fruits').children().eq(0).hasClass('and-stuff') - ).toBeTruthy(); - expect($fruits.children().eq(2).hasClass('pear')).toBeTruthy(); + expect($fruits.children().eq(1).hasClass('orange-fruits')).toBe(true); + expect($('.orange-fruits').children().eq(0).hasClass('and-stuff')).toBe( + true + ); + expect($fruits.children().eq(2).hasClass('pear')).toBe(true); expect($('.orange-fruits').children()).toHaveLength(1); }); @@ -153,18 +153,18 @@ describe('$(...)', function () { it('($(...)) : for each element it should add a wrapper elment and add the selected element as its child', function () { var $fruitDecorator = $('
'); $('li').wrap($fruitDecorator); - expect($fruits.children().eq(0).hasClass('fruit-decorator')).toBeTruthy(); - expect( - $fruits.children().eq(0).children().eq(0).hasClass('apple') - ).toBeTruthy(); - expect($fruits.children().eq(1).hasClass('fruit-decorator')).toBeTruthy(); - expect( - $fruits.children().eq(1).children().eq(0).hasClass('orange') - ).toBeTruthy(); - expect($fruits.children().eq(2).hasClass('fruit-decorator')).toBeTruthy(); - expect( - $fruits.children().eq(2).children().eq(0).hasClass('pear') - ).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('fruit-decorator')).toBe(true); + expect($fruits.children().eq(0).children().eq(0).hasClass('apple')).toBe( + true + ); + expect($fruits.children().eq(1).hasClass('fruit-decorator')).toBe(true); + expect($fruits.children().eq(1).children().eq(0).hasClass('orange')).toBe( + true + ); + expect($fruits.children().eq(2).hasClass('fruit-decorator')).toBe(true); + expect($fruits.children().eq(2).children().eq(0).hasClass('pear')).toBe( + true + ); }); }); @@ -285,18 +285,18 @@ describe('$(...)', function () { $('li').wrapInner($fruitDecorator); expect($('.fruit-decorator')).toHaveLength(3); - expect( - $children.eq(0).children().eq(0).hasClass('fruit-decorator') - ).toBeTruthy(); - expect($children.eq(0).hasClass('apple')).toBeTruthy(); - expect( - $children.eq(1).children().eq(0).hasClass('fruit-decorator') - ).toBeTruthy(); - expect($children.eq(1).hasClass('orange')).toBeTruthy(); - expect( - $children.eq(2).children().eq(0).hasClass('fruit-decorator') - ).toBeTruthy(); - expect($children.eq(2).hasClass('pear')).toBeTruthy(); + expect($children.eq(0).children().eq(0).hasClass('fruit-decorator')).toBe( + true + ); + expect($children.eq(0).hasClass('apple')).toBe(true); + expect($children.eq(1).children().eq(0).hasClass('fruit-decorator')).toBe( + true + ); + expect($children.eq(1).hasClass('orange')).toBe(true); + expect($children.eq(2).children().eq(0).hasClass('fruit-decorator')).toBe( + true + ); + expect($children.eq(2).hasClass('pear')).toBe(true); }); it('(html) : wraps with nested elements', function () { @@ -305,13 +305,13 @@ describe('$(...)', function () { ); $('.orange').wrapInner($badOrangeJoke); - expect( - $('.orange').children().eq(0).hasClass('orange-you-glad') - ).toBeTruthy(); + expect($('.orange').children().eq(0).hasClass('orange-you-glad')).toBe( + true + ); expect( $('.orange-you-glad').children().eq(0).hasClass('i-didnt-say-apple') - ).toBeTruthy(); - expect($fruits.children().eq(2).hasClass('pear')).toBeTruthy(); + ).toBe(true); + expect($fruits.children().eq(2).hasClass('pear')).toBe(true); expect($('.orange-you-glad').children()).toHaveLength(1); }); @@ -396,19 +396,19 @@ describe('$(...)', function () { it('(html) : should add element as last child', function () { $fruits.append('
  • Plum
  • '); - expect($fruits.children().eq(3).hasClass('plum')).toBeTruthy(); + expect($fruits.children().eq(3).hasClass('plum')).toBe(true); }); it('($(...)) : should add element as last child', function () { var $plum = $('
  • Plum
  • '); $fruits.append($plum); - expect($fruits.children().eq(3).hasClass('plum')).toBeTruthy(); + expect($fruits.children().eq(3).hasClass('plum')).toBe(true); }); it('(Node) : should add element as last child', function () { var plum = $('
  • Plum
  • ')[0]; $fruits.append(plum); - expect($fruits.children().eq(3).hasClass('plum')).toBeTruthy(); + expect($fruits.children().eq(3).hasClass('plum')).toBe(true); }); it('(existing Node) : should remove node from previous location', function () { @@ -461,15 +461,15 @@ describe('$(...)', function () { $apple.remove(); $fruits.append($apple); - expect($fruits.children().eq(2).hasClass('apple')).toBeTruthy(); + expect($fruits.children().eq(2).hasClass('apple')).toBe(true); }); it('($(...), html) : should add multiple elements as last children', function () { var $plum = $('
  • Plum
  • '); var grape = '
  • Grape
  • '; $fruits.append($plum, grape); - expect($fruits.children().eq(3).hasClass('plum')).toBeTruthy(); - expect($fruits.children().eq(4).hasClass('grape')).toBeTruthy(); + expect($fruits.children().eq(3).hasClass('plum')).toBe(true); + expect($fruits.children().eq(4).hasClass('grape')).toBe(true); }); it('(Array) : should append all elements in the array', function () { @@ -477,8 +477,8 @@ describe('$(...)', function () { '
  • Plum
  • Grape
  • ' ).get(); $fruits.append(more); - expect($fruits.children().eq(3).hasClass('plum')).toBeTruthy(); - expect($fruits.children().eq(4).hasClass('grape')).toBeTruthy(); + expect($fruits.children().eq(3).hasClass('plum')).toBe(true); + expect($fruits.children().eq(4).hasClass('grape')).toBe(true); }); it('(fn) : should invoke the callback with the correct arguments and context', function () { @@ -574,13 +574,13 @@ describe('$(...)', function () { it('(html) : should add element as first child', function () { $fruits.prepend('
  • Plum
  • '); - expect($fruits.children().eq(0).hasClass('plum')).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('plum')).toBe(true); }); it('($(...)) : should add element as first child', function () { var $plum = $('
  • Plum
  • '); $fruits.prepend($plum); - expect($fruits.children().eq(0).hasClass('plum')).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('plum')).toBe(true); }); it('($(...)) : should add style element as first child', function () { @@ -602,7 +602,7 @@ describe('$(...)', function () { it('(Node) : should add node as first child', function () { var plum = $('
  • Plum
  • ')[0]; $fruits.prepend(plum); - expect($fruits.children().eq(0).hasClass('plum')).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('plum')).toBe(true); }); it('(existing Node) : should remove existing nodes from previous locations', function () { @@ -640,7 +640,7 @@ describe('$(...)', function () { $apple.remove(); $fruits.prepend($apple); - expect($fruits.children().eq(0).hasClass('apple')).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('apple')).toBe(true); }); it('(Array) : should add all elements in the array as initial children', function () { @@ -648,16 +648,16 @@ describe('$(...)', function () { '
  • Plum
  • Grape
  • ' ).get(); $fruits.prepend(more); - expect($fruits.children().eq(0).hasClass('plum')).toBeTruthy(); - expect($fruits.children().eq(1).hasClass('grape')).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('plum')).toBe(true); + expect($fruits.children().eq(1).hasClass('grape')).toBe(true); }); it('(html, $(...), html) : should add multiple elements as first children', function () { var $plum = $('
  • Plum
  • '); var grape = '
  • Grape
  • '; $fruits.prepend($plum, grape); - expect($fruits.children().eq(0).hasClass('plum')).toBeTruthy(); - expect($fruits.children().eq(1).hasClass('grape')).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('plum')).toBe(true); + expect($fruits.children().eq(1).hasClass('grape')).toBe(true); }); it('(fn) : should invoke the callback with the correct arguments and context', function () { @@ -740,58 +740,58 @@ describe('$(...)', function () { describe('.appendTo', function () { it('(html) : should add element as last child', function () { var $plum = $('
  • Plum
  • ').appendTo(fruits); - expect($plum.parent().children().eq(3).hasClass('plum')).toBeTruthy(); + expect($plum.parent().children().eq(3).hasClass('plum')).toBe(true); }); it('($(...)) : should add element as last child', function () { $('
  • Plum
  • ').appendTo($fruits); - expect($fruits.children().eq(3).hasClass('plum')).toBeTruthy(); + expect($fruits.children().eq(3).hasClass('plum')).toBe(true); }); it('(Node) : should add element as last child', function () { $('
  • Plum
  • ').appendTo($fruits[0]); - expect($fruits.children().eq(3).hasClass('plum')).toBeTruthy(); + expect($fruits.children().eq(3).hasClass('plum')).toBe(true); }); it('(selector) : should add element as last child', function () { $('
  • Plum
  • ').appendTo('#fruits'); - expect($fruits.children().eq(3).hasClass('plum')).toBeTruthy(); + expect($fruits.children().eq(3).hasClass('plum')).toBe(true); }); it('(Array) : should add element as last child of all elements in the array', function () { var $multiple = $(''); $('
  • Plum
  • ').appendTo($multiple.get()); - expect($multiple.first().children().eq(1).hasClass('plum')).toBeTruthy(); - expect($multiple.last().children().eq(1).hasClass('plum')).toBeTruthy(); + expect($multiple.first().children().eq(1).hasClass('plum')).toBe(true); + expect($multiple.last().children().eq(1).hasClass('plum')).toBe(true); }); }); describe('.prependTo', function () { it('(html) : should add element as first child', function () { var $plum = $('
  • Plum
  • ').prependTo(fruits); - expect($plum.parent().children().eq(0).hasClass('plum')).toBeTruthy(); + expect($plum.parent().children().eq(0).hasClass('plum')).toBe(true); }); it('($(...)) : should add element as first child', function () { $('
  • Plum
  • ').prependTo($fruits); - expect($fruits.children().eq(0).hasClass('plum')).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('plum')).toBe(true); }); it('(Node) : should add node as first child', function () { $('
  • Plum
  • ').prependTo($fruits[0]); - expect($fruits.children().eq(0).hasClass('plum')).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('plum')).toBe(true); }); it('(selector) : should add element as first child', function () { $('
  • Plum
  • ').prependTo('#fruits'); - expect($fruits.children().eq(0).hasClass('plum')).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('plum')).toBe(true); }); it('(Array) : should add element as first child of all elements in the array', function () { var $multiple = $(''); $('
  • Plum
  • ').prependTo($multiple.get()); - expect($multiple.first().children().eq(0).hasClass('plum')).toBeTruthy(); - expect($multiple.last().children().eq(0).hasClass('plum')).toBeTruthy(); + expect($multiple.first().children().eq(0).hasClass('plum')).toBe(true); + expect($multiple.last().children().eq(0).hasClass('plum')).toBe(true); }); }); @@ -803,7 +803,7 @@ describe('$(...)', function () { it('(html) : should add element as next sibling', function () { var grape = '
  • Grape
  • '; $('.apple').after(grape); - expect($('.apple').next().hasClass('grape')).toBeTruthy(); + expect($('.apple').next().hasClass('grape')).toBe(true); }); it('(Array) : should add all elements in the array as next sibling', function () { @@ -811,20 +811,20 @@ describe('$(...)', function () { '
  • Plum
  • Grape
  • ' ).get(); $('.apple').after(more); - expect($fruits.children().eq(1).hasClass('plum')).toBeTruthy(); - expect($fruits.children().eq(2).hasClass('grape')).toBeTruthy(); + expect($fruits.children().eq(1).hasClass('plum')).toBe(true); + expect($fruits.children().eq(2).hasClass('grape')).toBe(true); }); it('($(...)) : should add element as next sibling', function () { var $plum = $('
  • Plum
  • '); $('.apple').after($plum); - expect($('.apple').next().hasClass('plum')).toBeTruthy(); + expect($('.apple').next().hasClass('plum')).toBe(true); }); it('(Node) : should add element as next sibling', function () { var plum = $('
  • Plum
  • ')[0]; $('.apple').after(plum); - expect($('.apple').next().hasClass('plum')).toBeTruthy(); + expect($('.apple').next().hasClass('plum')).toBe(true); }); it('(existing Node) : should remove existing nodes from previous locations', function () { @@ -869,8 +869,8 @@ describe('$(...)', function () { var $plum = $('
  • Plum
  • '); var grape = '
  • Grape
  • '; $('.apple').after($plum, grape); - expect($('.apple').next().hasClass('plum')).toBeTruthy(); - expect($('.plum').next().hasClass('grape')).toBeTruthy(); + expect($('.apple').next().hasClass('plum')).toBe(true); + expect($('.plum').next().hasClass('grape')).toBe(true); }); it('(fn) : should invoke the callback with the correct arguments and context', function () { @@ -942,63 +942,63 @@ describe('$(...)', function () { it('(selector) : should create element and add as next sibling', function () { var grape = $('
  • Grape
  • '); grape.insertAfter('.apple'); - expect($('.apple').next().hasClass('grape')).toBeTruthy(); + expect($('.apple').next().hasClass('grape')).toBe(true); }); it('(selector) : should create element and add as next sibling of multiple elements', function () { var grape = $('
  • Grape
  • '); grape.insertAfter('.apple, .pear'); - expect($('.apple').next().hasClass('grape')).toBeTruthy(); - expect($('.pear').next().hasClass('grape')).toBeTruthy(); + expect($('.apple').next().hasClass('grape')).toBe(true); + expect($('.pear').next().hasClass('grape')).toBe(true); }); it('($(...)) : should create element and add as next sibling', function () { var grape = $('
  • Grape
  • '); grape.insertAfter($('.apple')); - expect($('.apple').next().hasClass('grape')).toBeTruthy(); + expect($('.apple').next().hasClass('grape')).toBe(true); }); it('($(...)) : should create element and add as next sibling of multiple elements', function () { var grape = $('
  • Grape
  • '); grape.insertAfter($('.apple, .pear')); - expect($('.apple').next().hasClass('grape')).toBeTruthy(); - expect($('.pear').next().hasClass('grape')).toBeTruthy(); + expect($('.apple').next().hasClass('grape')).toBe(true); + expect($('.pear').next().hasClass('grape')).toBe(true); }); it('($(...)) : should create all elements in the array and add as next siblings', function () { var more = $('
  • Plum
  • Grape
  • '); more.insertAfter($('.apple')); - expect($fruits.children().eq(0).hasClass('apple')).toBeTruthy(); - expect($fruits.children().eq(1).hasClass('plum')).toBeTruthy(); - expect($fruits.children().eq(2).hasClass('grape')).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('apple')).toBe(true); + expect($fruits.children().eq(1).hasClass('plum')).toBe(true); + expect($fruits.children().eq(2).hasClass('grape')).toBe(true); }); it('(existing Node) : should remove existing nodes from previous locations', function () { $('.orange').insertAfter('.pear'); - expect($fruits.children().eq(1).hasClass('orange')).toBeFalsy(); + expect($fruits.children().eq(1).hasClass('orange')).toBe(false); expect($fruits.children().length).toBe(3); expect($('.orange').length).toBe(1); }); it('(existing Node) : should update original direct siblings', function () { $('.orange').insertAfter('.pear'); - expect($('.apple').next().hasClass('pear')).toBeTruthy(); - expect($('.pear').prev().hasClass('apple')).toBeTruthy(); - expect($('.pear').next().hasClass('orange')).toBeTruthy(); + expect($('.apple').next().hasClass('pear')).toBe(true); + expect($('.pear').prev().hasClass('apple')).toBe(true); + expect($('.pear').next().hasClass('orange')).toBe(true); expect($('.orange').next()).toHaveLength(0); }); it('(existing Node) : should update original direct siblings of multiple elements', function () { $('.apple').insertAfter('.orange, .pear'); expect($('.orange').prev()).toHaveLength(0); - expect($('.orange').next().hasClass('apple')).toBeTruthy(); - expect($('.pear').next().hasClass('apple')).toBeTruthy(); - expect($('.pear').prev().hasClass('apple')).toBeTruthy(); + expect($('.orange').next().hasClass('apple')).toBe(true); + expect($('.pear').next().hasClass('apple')).toBe(true); + expect($('.pear').prev().hasClass('apple')).toBe(true); expect($fruits.children().length).toBe(4); var apples = $('.apple'); expect(apples.length).toBe(2); - expect(apples.eq(0).prev().hasClass('orange')).toBeTruthy(); - expect(apples.eq(1).prev().hasClass('pear')).toBeTruthy(); + expect(apples.eq(0).prev().hasClass('orange')).toBe(true); + expect(apples.eq(1).prev().hasClass('pear')).toBe(true); }); it('(elem) : should handle if removed', function () { @@ -1014,7 +1014,7 @@ describe('$(...)', function () { expect($grape.cheerio).toBeTruthy(); expect($grape.each).toBeTruthy(); expect($grape.length).toBe(1); - expect($grape.hasClass('grape')).toBeTruthy(); + expect($grape.hasClass('grape')).toBe(true); }); it('(single) should return the new elements for chaining', function () { @@ -1024,8 +1024,8 @@ describe('$(...)', function () { expect($purple.cheerio).toBeTruthy(); expect($purple.each).toBeTruthy(); expect($purple.length).toBe(2); - expect($purple.eq(0).hasClass('grape')).toBeTruthy(); - expect($purple.eq(1).hasClass('plum')).toBeTruthy(); + expect($purple.eq(0).hasClass('grape')).toBe(true); + expect($purple.eq(1).hasClass('plum')).toBe(true); }); it('(multiple) should return the new elements for chaining', function () { @@ -1035,10 +1035,10 @@ describe('$(...)', function () { expect($purple.cheerio).toBeTruthy(); expect($purple.each).toBeTruthy(); expect($purple.length).toBe(4); - expect($purple.eq(0).hasClass('grape')).toBeTruthy(); - expect($purple.eq(1).hasClass('plum')).toBeTruthy(); - expect($purple.eq(2).hasClass('grape')).toBeTruthy(); - expect($purple.eq(3).hasClass('plum')).toBeTruthy(); + expect($purple.eq(0).hasClass('grape')).toBe(true); + expect($purple.eq(1).hasClass('plum')).toBe(true); + expect($purple.eq(2).hasClass('grape')).toBe(true); + expect($purple.eq(3).hasClass('plum')).toBe(true); }); it('(single) should return the existing element for chaining', function () { @@ -1046,7 +1046,7 @@ describe('$(...)', function () { expect($pear.cheerio).toBeTruthy(); expect($pear.each).toBeTruthy(); expect($pear.length).toBe(1); - expect($pear.hasClass('pear')).toBeTruthy(); + expect($pear.hasClass('pear')).toBe(true); }); it('(single) should return the existing elements for chaining', function () { @@ -1054,8 +1054,8 @@ describe('$(...)', function () { expect($things.cheerio).toBeTruthy(); expect($things.each).toBeTruthy(); expect($things.length).toBe(2); - expect($things.eq(0).hasClass('apple')).toBeTruthy(); - expect($things.eq(1).hasClass('orange')).toBeTruthy(); + expect($things.eq(0).hasClass('apple')).toBe(true); + expect($things.eq(1).hasClass('orange')).toBe(true); }); it('(multiple) should return the existing elements for chaining', function () { @@ -1064,10 +1064,10 @@ describe('$(...)', function () { expect($things.cheerio).toBeTruthy(); expect($things.each).toBeTruthy(); expect($things.length).toBe(4); - expect($things.eq(0).hasClass('apple')).toBeTruthy(); - expect($things.eq(1).hasClass('orange')).toBeTruthy(); - expect($things.eq(2).hasClass('apple')).toBeTruthy(); - expect($things.eq(3).hasClass('orange')).toBeTruthy(); + expect($things.eq(0).hasClass('apple')).toBe(true); + expect($things.eq(1).hasClass('orange')).toBe(true); + expect($things.eq(2).hasClass('apple')).toBe(true); + expect($things.eq(3).hasClass('orange')).toBe(true); }); }); @@ -1079,19 +1079,19 @@ describe('$(...)', function () { it('(html) : should add element as previous sibling', function () { var grape = '
  • Grape
  • '; $('.apple').before(grape); - expect($('.apple').prev().hasClass('grape')).toBeTruthy(); + expect($('.apple').prev().hasClass('grape')).toBe(true); }); it('($(...)) : should add element as previous sibling', function () { var $plum = $('
  • Plum
  • '); $('.apple').before($plum); - expect($('.apple').prev().hasClass('plum')).toBeTruthy(); + expect($('.apple').prev().hasClass('plum')).toBe(true); }); it('(Node) : should add element as previous sibling', function () { var plum = $('
  • Plum
  • ')[0]; $('.apple').before(plum); - expect($('.apple').prev().hasClass('plum')).toBeTruthy(); + expect($('.apple').prev().hasClass('plum')).toBe(true); }); it('(existing Node) : should remove existing nodes from previous locations', function () { @@ -1137,16 +1137,16 @@ describe('$(...)', function () { '
  • Plum
  • Grape
  • ' ).get(); $('.apple').before(more); - expect($fruits.children().eq(0).hasClass('plum')).toBeTruthy(); - expect($fruits.children().eq(1).hasClass('grape')).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('plum')).toBe(true); + expect($fruits.children().eq(1).hasClass('grape')).toBe(true); }); it('($(...), html) : should add multiple elements as previous siblings', function () { var $plum = $('
  • Plum
  • '); var grape = '
  • Grape
  • '; $('.apple').before($plum, grape); - expect($('.apple').prev().hasClass('grape')).toBeTruthy(); - expect($('.grape').prev().hasClass('plum')).toBeTruthy(); + expect($('.apple').prev().hasClass('grape')).toBe(true); + expect($('.grape').prev().hasClass('plum')).toBe(true); }); it('(fn) : should invoke the callback with the correct arguments and context', function () { @@ -1218,63 +1218,63 @@ describe('$(...)', function () { it('(selector) : should create element and add as prev sibling', function () { var grape = $('
  • Grape
  • '); grape.insertBefore('.apple'); - expect($('.apple').prev().hasClass('grape')).toBeTruthy(); + expect($('.apple').prev().hasClass('grape')).toBe(true); }); it('(selector) : should create element and add as prev sibling of multiple elements', function () { var grape = $('
  • Grape
  • '); grape.insertBefore('.apple, .pear'); - expect($('.apple').prev().hasClass('grape')).toBeTruthy(); - expect($('.pear').prev().hasClass('grape')).toBeTruthy(); + expect($('.apple').prev().hasClass('grape')).toBe(true); + expect($('.pear').prev().hasClass('grape')).toBe(true); }); it('($(...)) : should create element and add as prev sibling', function () { var grape = $('
  • Grape
  • '); grape.insertBefore($('.apple')); - expect($('.apple').prev().hasClass('grape')).toBeTruthy(); + expect($('.apple').prev().hasClass('grape')).toBe(true); }); it('($(...)) : should create element and add as next sibling of multiple elements', function () { var grape = $('
  • Grape
  • '); grape.insertBefore($('.apple, .pear')); - expect($('.apple').prev().hasClass('grape')).toBeTruthy(); - expect($('.pear').prev().hasClass('grape')).toBeTruthy(); + expect($('.apple').prev().hasClass('grape')).toBe(true); + expect($('.pear').prev().hasClass('grape')).toBe(true); }); it('($(...)) : should create all elements in the array and add as prev siblings', function () { var more = $('
  • Plum
  • Grape
  • '); more.insertBefore($('.apple')); - expect($fruits.children().eq(0).hasClass('plum')).toBeTruthy(); - expect($fruits.children().eq(1).hasClass('grape')).toBeTruthy(); - expect($fruits.children().eq(2).hasClass('apple')).toBeTruthy(); + expect($fruits.children().eq(0).hasClass('plum')).toBe(true); + expect($fruits.children().eq(1).hasClass('grape')).toBe(true); + expect($fruits.children().eq(2).hasClass('apple')).toBe(true); }); it('(existing Node) : should remove existing nodes from previous locations', function () { $('.pear').insertBefore('.apple'); - expect($fruits.children().eq(2).hasClass('pear')).toBeFalsy(); + expect($fruits.children().eq(2).hasClass('pear')).toBe(false); expect($fruits.children().length).toBe(3); expect($('.pear').length).toBe(1); }); it('(existing Node) : should update original direct siblings', function () { $('.pear').insertBefore('.apple'); - expect($('.apple').prev().hasClass('pear')).toBeTruthy(); - expect($('.apple').next().hasClass('orange')).toBeTruthy(); - expect($('.pear').next().hasClass('apple')).toBeTruthy(); + expect($('.apple').prev().hasClass('pear')).toBe(true); + expect($('.apple').next().hasClass('orange')).toBe(true); + expect($('.pear').next().hasClass('apple')).toBe(true); expect($('.pear').prev()).toHaveLength(0); }); it('(existing Node) : should update original direct siblings of multiple elements', function () { $('.pear').insertBefore('.apple, .orange'); - expect($('.apple').prev().hasClass('pear')).toBeTruthy(); - expect($('.apple').next().hasClass('pear')).toBeTruthy(); - expect($('.orange').prev().hasClass('pear')).toBeTruthy(); + expect($('.apple').prev().hasClass('pear')).toBe(true); + expect($('.apple').next().hasClass('pear')).toBe(true); + expect($('.orange').prev().hasClass('pear')).toBe(true); expect($('.orange').next()).toHaveLength(0); expect($fruits.children().length).toBe(4); var pears = $('.pear'); expect(pears.length).toBe(2); - expect(pears.eq(0).next().hasClass('apple')).toBeTruthy(); - expect(pears.eq(1).next().hasClass('orange')).toBeTruthy(); + expect(pears.eq(0).next().hasClass('apple')).toBe(true); + expect(pears.eq(1).next().hasClass('orange')).toBe(true); }); it('(elem) : should handle if removed', function () { @@ -1291,7 +1291,7 @@ describe('$(...)', function () { expect($grape.cheerio).toBeTruthy(); expect($grape.each).toBeTruthy(); expect($grape.length).toBe(1); - expect($grape.hasClass('grape')).toBeTruthy(); + expect($grape.hasClass('grape')).toBe(true); }); it('(single) should return the new elements for chaining', function () { @@ -1301,8 +1301,8 @@ describe('$(...)', function () { expect($purple.cheerio).toBeTruthy(); expect($purple.each).toBeTruthy(); expect($purple.length).toBe(2); - expect($purple.eq(0).hasClass('grape')).toBeTruthy(); - expect($purple.eq(1).hasClass('plum')).toBeTruthy(); + expect($purple.eq(0).hasClass('grape')).toBe(true); + expect($purple.eq(1).hasClass('plum')).toBe(true); }); it('(multiple) should return the new elements for chaining', function () { @@ -1312,10 +1312,10 @@ describe('$(...)', function () { expect($purple.cheerio).toBeTruthy(); expect($purple.each).toBeTruthy(); expect($purple.length).toBe(4); - expect($purple.eq(0).hasClass('grape')).toBeTruthy(); - expect($purple.eq(1).hasClass('plum')).toBeTruthy(); - expect($purple.eq(2).hasClass('grape')).toBeTruthy(); - expect($purple.eq(3).hasClass('plum')).toBeTruthy(); + expect($purple.eq(0).hasClass('grape')).toBe(true); + expect($purple.eq(1).hasClass('plum')).toBe(true); + expect($purple.eq(2).hasClass('grape')).toBe(true); + expect($purple.eq(3).hasClass('plum')).toBe(true); }); it('(single) should return the existing element for chaining', function () { @@ -1323,7 +1323,7 @@ describe('$(...)', function () { expect($orange.cheerio).toBeTruthy(); expect($orange.each).toBeTruthy(); expect($orange.length).toBe(1); - expect($orange.hasClass('orange')).toBeTruthy(); + expect($orange.hasClass('orange')).toBe(true); }); it('(single) should return the existing elements for chaining', function () { @@ -1331,8 +1331,8 @@ describe('$(...)', function () { expect($things.cheerio).toBeTruthy(); expect($things.each).toBeTruthy(); expect($things.length).toBe(2); - expect($things.eq(0).hasClass('orange')).toBeTruthy(); - expect($things.eq(1).hasClass('pear')).toBeTruthy(); + expect($things.eq(0).hasClass('orange')).toBe(true); + expect($things.eq(1).hasClass('pear')).toBe(true); }); it('(multiple) should return the existing elements for chaining', function () { @@ -1341,10 +1341,10 @@ describe('$(...)', function () { expect($things.cheerio).toBeTruthy(); expect($things.each).toBeTruthy(); expect($things.length).toBe(4); - expect($things.eq(0).hasClass('apple')).toBeTruthy(); - expect($things.eq(1).hasClass('orange')).toBeTruthy(); - expect($things.eq(2).hasClass('apple')).toBeTruthy(); - expect($things.eq(3).hasClass('orange')).toBeTruthy(); + expect($things.eq(0).hasClass('apple')).toBe(true); + expect($things.eq(1).hasClass('orange')).toBe(true); + expect($things.eq(2).hasClass('apple')).toBe(true); + expect($things.eq(3).hasClass('orange')).toBe(true); }); }); @@ -1381,9 +1381,9 @@ describe('$(...)', function () { it('(elem) : should replace one
  • tag with another', function () { var $plum = $('
  • Plum
  • '); $('.orange').replaceWith($plum); - expect($('.apple').next().hasClass('plum')).toBeTruthy(); + expect($('.apple').next().hasClass('plum')).toBe(true); expect($('.apple').next().html()).toBe('Plum'); - expect($('.pear').prev().hasClass('plum')).toBeTruthy(); + expect($('.pear').prev().hasClass('plum')).toBe(true); expect($('.pear').prev().html()).toBe('Plum'); }); @@ -1393,10 +1393,10 @@ describe('$(...)', function () { ).get(); $('.orange').replaceWith(more); - expect($fruits.children().eq(1).hasClass('plum')).toBeTruthy(); - expect($fruits.children().eq(2).hasClass('grape')).toBeTruthy(); - expect($('.apple').next().hasClass('plum')).toBeTruthy(); - expect($('.pear').prev().hasClass('grape')).toBeTruthy(); + expect($fruits.children().eq(1).hasClass('plum')).toBe(true); + expect($fruits.children().eq(2).hasClass('grape')).toBe(true); + expect($('.apple').next().hasClass('plum')).toBe(true); + expect($('.pear').prev().hasClass('grape')).toBe(true); expect($fruits.children()).toHaveLength(4); }); @@ -1422,7 +1422,7 @@ describe('$(...)', function () { $pear.remove(); $pear.replaceWith($plum); - expect($('.orange').next().hasClass('plum')).toBeFalsy(); + expect($('.orange').next().hasClass('plum')).toBe(false); }); it('(elem) : should replace the single selected element with given element', function () { diff --git a/test/api/traversing.js b/test/api/traversing.js index 12ac036e6c..92da250c4f 100644 --- a/test/api/traversing.js +++ b/test/api/traversing.js @@ -969,13 +969,13 @@ describe('$(...)', function () { it('() : should return an array containing all of the collection', function () { var children = $('#fruits').children(); var all = children.get(); - expect(Array.isArray(all)).toBeTruthy(); + expect(Array.isArray(all)).toBe(true); expect(all).toStrictEqual([children[0], children[1], children[2]]); }); }); describe('.index', function () { - describe('() : ', function () { + describe('() :', function () { it('returns the index of a child amongst its siblings', function () { expect($('.orange').index()).toBe(1); }); @@ -984,7 +984,7 @@ describe('$(...)', function () { }); }); - describe('(selector) : ', function () { + describe('(selector) :', function () { it('returns the index of the first element in the set matched by `selector`', function () { expect($('.apple').index('#fruits, li')).toBe(1); }); @@ -996,7 +996,7 @@ describe('$(...)', function () { }); }); - describe('(node) : ', function () { + describe('(node) :', function () { it('returns the index of the given node within the current selection', function () { var $lis = $('li'); expect($lis.index($lis.get(1))).toBe(1); @@ -1014,7 +1014,7 @@ describe('$(...)', function () { }); }); - describe('(selection) : ', function () { + describe('(selection) :', function () { it('returns the index of the first node in the provided selection within the current selection', function () { var $lis = $('li'); expect($lis.index($('.orange, .pear'))).toBe(1); @@ -1394,7 +1394,7 @@ describe('$(...)', function () { }); describe('.addBack', function () { - describe('() : ', function () { + describe('() :', function () { it('includes siblings and self', function () { var $selection = $('.orange').siblings().addBack();