Skip to content

Commit

Permalink
Fixed countVowels Test cases.
Browse files Browse the repository at this point in the history
Signed-off-by: Sahil Suman <[email protected]>
  • Loading branch information
sahilsuman933 committed Dec 3, 2023
1 parent 539ab3e commit 604e50e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions 01-js/tests/countVowels.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ const countVowels = require('../medium/countVowels');
describe('countVowels', () => {
test('returns the correct count for strings with vowels', () => {
expect(countVowels('hello')).toBe(2);
expect(countVowels('programming')).toBe(4);
expect(countVowels('OpenAI')).toBe(3);
expect(countVowels('programming')).toBe(3);
expect(countVowels('OpenAI')).toBe(4);
});

test('returns 0 for strings without vowels', () => {
expect(countVowels('rhythm')).toBe(0);
expect(countVowels('fly')).toBe(0);
expect(countVowels('chatbot')).toBe(0);
expect(countVowels('chatbot')).toBe(2);
});

test('returns 0 for an empty string', () => {
expect(countVowels('')).toBe(0);
});

test('handles case-insensitivity correctly', () => {
expect(countVowels('EaSiEr')).toBe(3);
expect(countVowels('EaSiEr')).toBe(4);
expect(countVowels('QUIET')).toBe(3);
expect(countVowels('aEIOU')).toBe(5);
});
Expand Down

0 comments on commit 604e50e

Please sign in to comment.