-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathisPalindrome.spec.js
39 lines (33 loc) · 1.01 KB
/
isPalindrome.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const assert = require('assert');
const {expect} = require('chai');
const {isPalindrome} = require('../index');
describe('function isPalindrome', () => {
it('should return true if value palindrome', () => {
assert.equal(isPalindrome('Anna'), true);
});
// Chai
it('should return true if value palindrome', () => {
expect(isPalindrome('Anna')).true;
});
it('should return false if value not palindrome', () => {
assert.equal(isPalindrome('Guram'), false);
});
// Chai
it('should return false if value not palindrome', () => {
expect(isPalindrome('Guram')).false;
});
it('should return false if value not string', () => {
assert.equal(isPalindrome(123), false);
});
// Chai
it('should return false if value not string', () => {
expect(isPalindrome(123)).false;
});
it('should return false for empty value',() => {
assert.equal(isPalindrome(''), false);
});
// Chai
it('should return false for empty string',() => {
expect(isPalindrome('')).false;
});
});