From 8a0f96deec3ad988a17202d740130c899fc778ce Mon Sep 17 00:00:00 2001 From: cedoor Date: Sun, 1 Sep 2019 13:13:53 +0200 Subject: [PATCH] [test] add string capitalize tests --- test/test.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/test.js b/test/test.js index 82cde29..980f528 100644 --- a/test/test.js +++ b/test/test.js @@ -1,9 +1,13 @@ const tape = require('tape') const cutls = require('../dist/cutls') -tape('Strings module tests', function (test) { - test.equal(cutls.strings.capitalizeWord('hello'), 'Hello') - test.equal(cutls.strings.capitalizeWords('hello world'), 'Hello World') - test.deepEqual(cutls.strings.capitalizeWordList(['hello', 'world']), ['Hello', 'World']) +/** String module tests **/ + +tape('Capitalize functions', function (test) { + test.equal(cutls.strings.capitalize('hello'), 'Hello') + test.deepEqual(cutls.strings.capitalizeList(['hello', 'world']), ['Hello', 'World']) + test.throws(() => cutls.strings.capitalize(1)) + test.throws(() => cutls.strings.capitalize(true)) + test.throws(() => cutls.strings.capitalizeList(['hello', 1])) test.end() })