From 05cea2da3d672b5ff64a196fb4fd976bad6495e0 Mon Sep 17 00:00:00 2001 From: Ivan Jovanovic Date: Fri, 3 Feb 2017 09:27:52 +0100 Subject: [PATCH 1/2] test, url: updated assertions in url-searchparams-getall tests --- .../test-whatwg-url-searchparams-getall.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/parallel/test-whatwg-url-searchparams-getall.js b/test/parallel/test-whatwg-url-searchparams-getall.js index df055e009e7e4d..c75266a7b8b482 100644 --- a/test/parallel/test-whatwg-url-searchparams-getall.js +++ b/test/parallel/test-whatwg-url-searchparams-getall.js @@ -25,15 +25,17 @@ test(function() { test(function() { var params = new URLSearchParams('a=1&a=2&a=3&a'); - assert_true(params.has('a'), 'Search params object has name "a"'); + assert_true(params.has('a'), `Search params object doesn't have name "a"`); var matches = params.getAll('a'); - assert_true(matches && matches.length == 4, 'Search params object has values for name "a"'); - assert_array_equals(matches, ['1', '2', '3', ''], 'Search params object has expected name "a" values'); + assert(matches); + assert_equals(matches.length, 4, `Unexpected length of name "a" values in search params object: ${matches.length}`); + assert_array_equals(matches, ['1', '2', '3', ''], `Unexpected name "a" values: ${matches}`); params.set('a', 'one'); - assert_equals(params.get('a'), 'one', 'Search params object has name "a" with value "one"'); - var matches = params.getAll('a'); - assert_true(matches && matches.length == 1, 'Search params object has values for name "a"'); - assert_array_equals(matches, ['one'], 'Search params object has expected name "a" values'); + assert_equals(params.get('a'), 'one', `Search params object doesn't have name "a" with value "one"`); + matches = params.getAll('a'); + assert(matches); + assert_equals(matches.length, 1, `Unexpected length of name "a" values in search params object: ${matches.length}`); + assert_array_equals(matches, ['one'], `Unexpected name "a" values: ${matches}`); }, 'getAll() multiples'); /* eslint-enable */ From 0db818b8729524aff084b8029464957b3eeffce8 Mon Sep 17 00:00:00 2001 From: Ivan Jovanovic Date: Fri, 3 Feb 2017 17:36:29 +0100 Subject: [PATCH 2/2] Fixed lint problems --- .../test-whatwg-url-searchparams-getall.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-whatwg-url-searchparams-getall.js b/test/parallel/test-whatwg-url-searchparams-getall.js index c75266a7b8b482..1d9ad403cd3259 100644 --- a/test/parallel/test-whatwg-url-searchparams-getall.js +++ b/test/parallel/test-whatwg-url-searchparams-getall.js @@ -25,17 +25,22 @@ test(function() { test(function() { var params = new URLSearchParams('a=1&a=2&a=3&a'); - assert_true(params.has('a'), `Search params object doesn't have name "a"`); + assert_true(params.has('a'), 'Search params object doesn\'t have name "a"'); var matches = params.getAll('a'); assert(matches); - assert_equals(matches.length, 4, `Unexpected length of name "a" values in search params object: ${matches.length}`); - assert_array_equals(matches, ['1', '2', '3', ''], `Unexpected name "a" values: ${matches}`); + assert_equals(matches.length, 4, `Unexpected length of name "a" values in + search params object: ${matches.length}`); + assert_array_equals(matches, ['1', '2', '3', ''], `Unexpected name "a" + values: ${matches}`); params.set('a', 'one'); - assert_equals(params.get('a'), 'one', `Search params object doesn't have name "a" with value "one"`); + assert_equals(params.get('a'), 'one', 'Search params object doesn\'t ' + + 'have name "a" with value "one"'); matches = params.getAll('a'); assert(matches); - assert_equals(matches.length, 1, `Unexpected length of name "a" values in search params object: ${matches.length}`); - assert_array_equals(matches, ['one'], `Unexpected name "a" values: ${matches}`); + assert_equals(matches.length, 1, `Unexpected length of name "a" values in + search params object: ${matches.length}`); + assert_array_equals(matches, ['one'], `Unexpected name "a" values: + ${matches}`); }, 'getAll() multiples'); /* eslint-enable */