Skip to content

Commit

Permalink
Adding uppercase skeleton and its test
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmota committed Oct 19, 2017
1 parent 954f206 commit 7be3fe5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/uppercase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Write a function that returns the specified string in uppercase
// Parameter S is a String.
function uppercase(s) {
// Your code goes here
}

module.exports = uppercase;
17 changes: 17 additions & 0 deletions test/uppercase.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const { uppercase } = require('../lib');

test('string "abc" uppercased equals "ABC"', () => {
expect(uppercase('abc')).toBe('ABC');
});

test('empty string uppercased is still empty string', () => {
expect(uppercase('')).toBe('');
});

test('string "Symbols and punctuation (!@#$%) stay the same." uppercased equals "SYMBOLS AND PUNCTUATION (!@#$%) STAY THE SAME."', () => {
expect(uppercase('Symbols and punctuation (!@#$%) stay the same.')).toBe('SYMBOLS AND PUNCTUATION (!@#$%) STAY THE SAME.');
});

test('string "Special characters (á, é, ç, etc.) do change" uppercased equals "SPECIAL CHARACTERS (Á, É, Ç, ETC.) DO CHANGE"', () => {
expect(uppercase('Special characters (á, é, ç, etc.) do change')).toBe('SPECIAL CHARACTERS (Á, É, Ç, ETC.) DO CHANGE');
});

0 comments on commit 7be3fe5

Please sign in to comment.