Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions foundations/13_palindromes/palindromes.spec.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
const palindromes = require('./palindromes')

describe('palindromes', () => {
test('works with single words', () => {
test('detects palindrome', () => {
expect(palindromes('racecar')).toBe(true);
});
test.skip('works with punctuation ', () => {
expect(palindromes('racecar!')).toBe(true);
});
test.skip('works with upper-case letters ', () => {
expect(palindromes('Racecar!')).toBe(true);
test.skip('detects palindrome with numbers', () => {
expect(palindromes('rac3e3car')).toBe(true);
});
test.skip('works with multiple words', () => {
test.skip('detects palindrome with multiple words', () => {
expect(palindromes('A car, a man, a maraca.')).toBe(true);
});
test.skip('works with multiple words', () => {
expect(palindromes('Animal loots foliated detail of stool lamina.')).toBe(true);
test.skip('ignores punctuation', () => {
expect(palindromes('racecar!')).toBe(true);
});
test.skip('doesn\'t just always return true', () => {
expect(palindromes('ZZZZ car, a man, a maracaz.')).toBe(false);
test.skip('is case insensitive', () => {
expect(palindromes('Racecar!')).toBe(true);
});
test.skip('works with numbers in a string', () => {
expect(palindromes('rac3e3car')).toBe(true);
test.skip('detects non-palindromes', () => {
expect(palindromes('ZZZZ car, a man, a maracaz.')).toBe(false);
});
test.skip('works with unevenly spaced numbers in a string', () => {
test.skip('detects non-palindromes with numbers', () => {
expect(palindromes('r3ace3car')).toBe(false);
});
});
27 changes: 11 additions & 16 deletions foundations/13_palindromes/solution/palindromes-solution.spec.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
const palindromes = require('./palindromes-solution');

describe('palindromes', () => {
test('works with single words', () => {
test('detects palindrome', () => {
expect(palindromes('racecar')).toBe(true);
});
test('works with punctuation ', () => {
expect(palindromes('racecar!')).toBe(true);
});
test('works with upper-case letters ', () => {
expect(palindromes('Racecar!')).toBe(true);
test('detects palindrome with numbers', () => {
expect(palindromes('rac3e3car')).toBe(true);
});
test('works with multiple words', () => {
test('detects palindrome with multiple words', () => {
expect(palindromes('A car, a man, a maraca.')).toBe(true);
});
test('works with multiple words', () => {
expect(palindromes('Animal loots foliated detail of stool lamina.')).toBe(
true
);
test('ignores punctuation', () => {
expect(palindromes('racecar!')).toBe(true);
});
test("doesn't just always return true", () => {
expect(palindromes('ZZZZ car, a man, a maraca.')).toBe(false);
test('is case insensitive', () => {
expect(palindromes('Racecar!')).toBe(true);
});
test('works with numbers in a string', () => {
expect(palindromes('rac3e3car')).toBe(true);
test('detects non-palindromes', () => {
expect(palindromes('ZZZZ car, a man, a maracaz.')).toBe(false);
});
test('works with unevenly spaced numbers in a string', () => {
test('detects non-palindromes with numbers', () => {
expect(palindromes('r3ace3car')).toBe(false);
});
});