From 341be9c0a607d7b4ef65fbc88fc781141d6e9b66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Wed, 10 Jan 2018 12:13:21 +0100 Subject: [PATCH] add 2 tests for toSnakeCase & truthCheckCollection --- test/toSnakeCase/toSnakeCase.test.js | 5 +++++ test/truthCheckCollection/truthCheckCollection.test.js | 1 + 2 files changed, 6 insertions(+) diff --git a/test/toSnakeCase/toSnakeCase.test.js b/test/toSnakeCase/toSnakeCase.test.js index d0fd48975..ae281a8a0 100644 --- a/test/toSnakeCase/toSnakeCase.test.js +++ b/test/toSnakeCase/toSnakeCase.test.js @@ -5,6 +5,11 @@ test('Testing toSnakeCase', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof toSnakeCase === 'function', 'toSnakeCase is a Function'); + t.equal(toSnakeCase('camelCase'), 'camel_case', "string converts to snake case"); + t.equal(toSnakeCase('some text'), 'some_text', "string converts to snake case"); + t.equal(toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens'), 'some_mixed_string_with_spaces_underscores_and_hyphens', "string converts to snake case"); + t.equal(toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'), 'i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html', "string converts to snake case"); + //t.deepEqual(toSnakeCase(args..), 'Expected'); //t.equal(toSnakeCase(args..), 'Expected'); //t.false(toSnakeCase(args..), 'Expected'); diff --git a/test/truthCheckCollection/truthCheckCollection.test.js b/test/truthCheckCollection/truthCheckCollection.test.js index 5e7d6864b..80479572d 100644 --- a/test/truthCheckCollection/truthCheckCollection.test.js +++ b/test/truthCheckCollection/truthCheckCollection.test.js @@ -5,6 +5,7 @@ test('Testing truthCheckCollection', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof truthCheckCollection === 'function', 'truthCheckCollection is a Function'); + t.equal(truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex: 'male' }], 'sex'), true, "second argument is truthy on all elements of a collection"); //t.deepEqual(truthCheckCollection(args..), 'Expected'); //t.equal(truthCheckCollection(args..), 'Expected'); //t.false(truthCheckCollection(args..), 'Expected');