Skip to content

Commit e8a3c00

Browse files
committed
tests: add getRandomLetter from array
1 parent 926d5a6 commit e8a3c00

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/test.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,23 @@ describe('getRandomLetter', function () {
88
assert.strictEqual(typeof getRandomLetter('ert123%^&'), 'string')
99
})
1010

11-
it('should return a value from param', function () {
11+
it('should return a value from string', function () {
1212
assert.strictEqual('asd'.includes(getRandomLetter('asd')), true)
1313
assert.strictEqual('234'.includes(getRandomLetter('234')), true)
1414
assert.strictEqual('ert123%^&'.includes(getRandomLetter('ert123%^&')), true)
1515
})
16+
17+
it('should return a value from array', function () {
18+
assert.strictEqual(['a', 's', 'd'].includes(getRandomLetter(['a', 's', 'd'])), true)
19+
assert.strictEqual([2, 3, 4].includes(getRandomLetter([2, 3, 4])), true)
20+
assert.strictEqual(
21+
['e', 'r', 't', 1, 2, 3, '%', '^', '&']
22+
.includes(
23+
getRandomLetter(['e', 'r', 't', 1, 2, 3, '%', '^', '&'])
24+
)
25+
, true
26+
)
27+
})
1628
})
1729

1830
describe('replace', function () {

0 commit comments

Comments
 (0)