Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
24
Task/Test-a-function/JavaScript/test-a-function.js
Normal file
24
Task/Test-a-function/JavaScript/test-a-function.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
const assert = require('assert');
|
||||
|
||||
describe('palindrome', () => {
|
||||
const pali = require('../lib/palindrome');
|
||||
|
||||
describe('.check()', () => {
|
||||
it('should return true on encountering a palindrome', () => {
|
||||
assert.ok(pali.check('racecar'));
|
||||
assert.ok(pali.check('abcba'));
|
||||
assert.ok(pali.check('aa'));
|
||||
assert.ok(pali.check('a'));
|
||||
});
|
||||
|
||||
it('should return true on encountering an empty string', () => {
|
||||
assert.ok(pali.check(''));
|
||||
});
|
||||
|
||||
it('should return false on encountering a non-palindrome', () => {
|
||||
assert.ok(!pali.check('alice'));
|
||||
assert.ok(!pali.check('ab'));
|
||||
assert.ok(!pali.check('abcdba'));
|
||||
});
|
||||
})
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue