2023-02-01 15:53:54 -08:00
|
|
|
const palindromes = require('./palindromes-solution');
|
2022-02-20 11:07:44 -08:00
|
|
|
|
2023-02-01 15:53:54 -08:00
|
|
|
describe('palindromes', () => {
|
|
|
|
test('works with single words', () => {
|
|
|
|
expect(palindromes('racecar')).toBe(true);
|
2023-01-21 09:53:41 -08:00
|
|
|
});
|
2023-02-01 15:58:58 -08:00
|
|
|
test('works with punctuation ', () => {
|
2023-02-01 15:53:54 -08:00
|
|
|
expect(palindromes('racecar!')).toBe(true);
|
2023-01-21 09:53:41 -08:00
|
|
|
});
|
2023-02-01 15:58:58 -08:00
|
|
|
test('works with upper-case letters ', () => {
|
2023-02-01 15:53:54 -08:00
|
|
|
expect(palindromes('Racecar!')).toBe(true);
|
2023-01-21 09:53:41 -08:00
|
|
|
});
|
2023-02-01 15:58:58 -08:00
|
|
|
test('works with multiple words', () => {
|
2023-02-01 15:53:54 -08:00
|
|
|
expect(palindromes('A car, a man, a maraca.')).toBe(true);
|
2023-01-21 09:53:41 -08:00
|
|
|
});
|
2023-02-01 15:58:58 -08:00
|
|
|
test('works with multiple words', () => {
|
2023-02-01 15:53:54 -08:00
|
|
|
expect(palindromes('Animal loots foliated detail of stool lamina.')).toBe(
|
2023-01-21 09:53:41 -08:00
|
|
|
true
|
|
|
|
);
|
|
|
|
});
|
2023-02-01 15:58:58 -08:00
|
|
|
test("doesn't just always return true", () => {
|
2023-02-01 15:53:54 -08:00
|
|
|
expect(palindromes('ZZZZ car, a man, a maraca.')).toBe(false);
|
2023-01-21 09:53:41 -08:00
|
|
|
});
|
2022-02-20 11:07:44 -08:00
|
|
|
});
|