forked from BlakeGuilloud/ganon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding uppercase skeleton and its test
- Loading branch information
1 parent
954f206
commit 7be3fe5
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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; |
This file contains 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
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'); | ||
}); |