diff --git a/tests/lib/globeCoordinate/globeCoordinate.Formatter.tests.js b/tests/lib/globeCoordinate/globeCoordinate.Formatter.tests.js index 5280d61..af2f80e 100644 --- a/tests/lib/globeCoordinate/globeCoordinate.Formatter.tests.js +++ b/tests/lib/globeCoordinate/globeCoordinate.Formatter.tests.js @@ -13,6 +13,7 @@ define( [ QUnit.module( 'globeCoordinate.Formatter.js' ); QUnit.test( 'Formatting', function( assert ) { + assert.expect( 8 ); var decimalTexts = { '1, 1': new GlobeCoordinate( { latitude: 1, longitude: 1, precision: 1 } ), '-10, -1.5': new GlobeCoordinate( { latitude: -10, longitude: -1.5, precision: 0.1 } ), @@ -51,6 +52,7 @@ define( [ } ); QUnit.test( 'precisionText()', function( assert ) { + assert.expect( 4 ); var precisions = { 1: '±1°', 0.016666666666666666: 'to an arcminute', diff --git a/tests/lib/globeCoordinate/globeCoordinate.GlobeCoordinate.tests.js b/tests/lib/globeCoordinate/globeCoordinate.GlobeCoordinate.tests.js index 25738c1..0f00da8 100644 --- a/tests/lib/globeCoordinate/globeCoordinate.GlobeCoordinate.tests.js +++ b/tests/lib/globeCoordinate/globeCoordinate.GlobeCoordinate.tests.js @@ -14,6 +14,7 @@ define( [ QUnit.module( 'globeCoordinate.GlobeCoordinate.js' ); QUnit.test( 'Basic checks', function( assert ) { + assert.expect( 12 ); var c; assert.throws( @@ -94,6 +95,7 @@ define( [ } ); QUnit.test( 'Strict (in)equality', function( assert ) { + assert.expect( 121 ); var gcDefs = [ { latitude: 0, longitude: 0, precision: 1 }, { latitude: -3, longitude: 2, precision: 1 }, @@ -135,6 +137,7 @@ define( [ } ); QUnit.test( 'Loose equality', function( assert ) { + assert.expect( 7 ); var gcDefs = [ { latitude: 0, longitude: 0, precision: 1 }, { latitude: 0.01, longitude: 0, precision: 1 }, @@ -157,6 +160,7 @@ define( [ } ); QUnit.test( 'Loose inequality', function( assert ) { + assert.expect( 4 ); var c1 = new globeCoordinate.GlobeCoordinate( { latitude: 0, longitude: 0, precision: 1 / 3600 } ), diff --git a/tests/lib/globeCoordinate/globeCoordinate.tests.js b/tests/lib/globeCoordinate/globeCoordinate.tests.js index 62313bb..bbaddc8 100644 --- a/tests/lib/globeCoordinate/globeCoordinate.tests.js +++ b/tests/lib/globeCoordinate/globeCoordinate.tests.js @@ -163,6 +163,7 @@ define( [ QUnit.module( 'globeCoordinate.js' ); QUnit.test( 'Applying precision', function( assert ) { + assert.expect( 70 ); $.each( precisions, function( precision, expected ) { $.each( values, function( i, value ) { @@ -179,6 +180,7 @@ define( [ } ); QUnit.test( 'Converting to degree', function( assert ) { + assert.expect( 70 ); $.each( precisions, function( precision, expected ) { $.each( values, function( i, value ) { @@ -199,6 +201,7 @@ define( [ } ); QUnit.test( 'iso6709()', function( assert ) { + assert.expect( 10 ); $.each( iso6709representations, function( iso6709string, gcDef ) { assert.equal( diff --git a/tests/src/dataValues.tests.js b/tests/src/dataValues.tests.js index ad2d86b..72eb3f2 100644 --- a/tests/src/dataValues.tests.js +++ b/tests/src/dataValues.tests.js @@ -12,73 +12,67 @@ define( [ QUnit.module( 'dataValues.js' ); - QUnit.test( - 'getDataValues', - function( assert ) { - var dvs = dv.getDataValues(); + QUnit.test( 'getDataValues', function( assert ) { + var dvs = dv.getDataValues(); + assert.expect( dvs.length * 2 + 1 ); - assert.ok( $.isArray( dvs ), 'Returns an array' ); + assert.ok( $.isArray( dvs ), 'Returns an array' ); - for ( var i = 0, s = dvs.length; i < s; i++ ) { - assert.ok( - typeof dvs[i] === 'string', - 'Returned DV type "' + dvs[i] + '" is a string' - ); + for ( var i = 0, s = dvs.length; i < s; i++ ) { + assert.ok( + typeof dvs[i] === 'string', + 'Returned DV type "' + dvs[i] + '" is a string' + ); - assert.ok( - dv.hasDataValue( dvs[i] ), - 'Returned DV type "' + dvs[i] + '" is present according to hasDataValue' - ); - } + assert.ok( + dv.hasDataValue( dvs[i] ), + 'Returned DV type "' + dvs[i] + '" is present according to hasDataValue' + ); } - ); + } ); - QUnit.test( - 'hasDataValue', - function( assert ) { - // Already partially tested in getDataValues + QUnit.test( 'hasDataValue', function( assert ) { + assert.expect( 2 ); + // Already partially tested in getDataValues - assert.strictEqual( - dv.hasDataValue( 'in your code, being silly' ), - false, - 'Non existing DV type is not present' - ); + assert.strictEqual( + dv.hasDataValue( 'in your code, being silly' ), + false, + 'Non existing DV type is not present' + ); - var dvs = dv.getDataValues(); + var dvs = dv.getDataValues(); - assert.strictEqual( - dv.hasDataValue( dvs.pop() ), - true, - 'Existing DV type is present' - ); - } - ); + assert.strictEqual( + dv.hasDataValue( dvs.pop() ), + true, + 'Existing DV type is present' + ); + } ); - QUnit.test( - 'newDataValue', - function( assert ) { - // This test needs dv.MonolingualTextValue to be loaded and registered + QUnit.test( 'newDataValue', function( assert ) { + assert.expect( 2 ); + // This test needs dv.MonolingualTextValue to be loaded and registered - var dataValue = dv.newDataValue( - 'monolingualtext', - { - 'language': 'en', - 'text': '~=[,,_,,]:3' - } - ); + var dataValue = dv.newDataValue( + 'monolingualtext', + { + 'language': 'en', + 'text': '~=[,,_,,]:3' + } + ); - assert.strictEqual( - dataValue.getText(), - '~=[,,_,,]:3', - 'Value was constructed and the text was set correctly' - ); + assert.strictEqual( + dataValue.getText(), + '~=[,,_,,]:3', + 'Value was constructed and the text was set correctly' + ); - assert.strictEqual( - dataValue.getLanguageCode(), - 'en', - 'Value was constructed and the language code was set correctly' - ); - } - ); + assert.strictEqual( + dataValue.getLanguageCode(), + 'en', + 'Value was constructed and the language code was set correctly' + ); + } ); } ); diff --git a/tests/src/valueParsers/valueParsers.tests.js b/tests/src/valueParsers/valueParsers.tests.js index 47ca3d7..6fb62a0 100644 --- a/tests/src/valueParsers/valueParsers.tests.js +++ b/tests/src/valueParsers/valueParsers.tests.js @@ -140,4 +140,4 @@ }; -}( valueParsers, dataValues, util, jQuery, QUnit ) ); \ No newline at end of file +}( valueParsers, dataValues, util, jQuery, QUnit ) );