Skip to content

Commit

Permalink
Merge pull request #1 from sahilsuman933/vowel-testcase
Browse files Browse the repository at this point in the history
[Bug] Fixed countVowels Test cases.
  • Loading branch information
hkirat committed Dec 4, 2023
2 parents 539ab3e + 604e50e commit cf59b6a
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 cf59b6a

Please sign in to comment.