Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

Commit

Permalink
[test] add string capitalize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cedoor committed Sep 1, 2019
1 parent 3ca4598 commit 8a0f96d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -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()
})

0 comments on commit 8a0f96d

Please sign in to comment.