Last active
March 8, 2019 01:38
-
-
Save MeetMartin/a84710771f8d16b89110f33773c021cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { assert } from 'chai'; | |
import TextTransformation from '../src/text-transform-oop'; | |
describe('test atomic functions', () => { | |
it('capitalize(text) turns first character to Capital', | |
() => assert.strictEqual(TextTransformation.capitalize("pReSiDeNt"), 'PReSiDeNt')); | |
it('addExclamationMark(text) adds !', | |
() => assert.strictEqual(TextTransformation.addExclamationMark("text"), 'text!')); | |
it('addPunctuation(text) adds .', | |
() => assert.strictEqual(TextTransformation.addPunctuation("text"), 'text.')); | |
}); | |
describe('test composed functions', () => { | |
it('makeImportant(text) makes it capitalized, trimmed with ! at the end.', | |
() => assert.strictEqual(TextTransformation.makeImportant(' pReSiDeNt '), 'President!')); | |
it('makeUnimportant(text) makes it lowercase, trimmed with . at the end.', | |
() => assert.strictEqual(TextTransformation.makeUnimportant(' pReSiDeNt '), 'president.')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment