Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
|
|
@ -1,2 +1,2 @@
|
|||
{{omit from|BBC BASIC}}
|
||||
Using a well known testing specific library/module/suite for your language, write some tests for your language's entry in [[Palindrome]]. If your language does not have a testing specific library well known to the language's community then state this or omit the language.
|
||||
Using a well-known testing-specific library/module/suite for your language, write some tests for your language's entry in [[Palindrome]]. If your language does not have a testing specific library well known to the language's community then state this or omit the language.
|
||||
|
|
|
|||
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