Files
odin-javascript-exercises/snakeCase/snakeCase.spec.js
T

23 lines
838 B
JavaScript
Raw Normal View History

2018-08-07 11:23:28 +01:00
const snakeCase = require('./snakeCase')
2017-08-25 14:16:42 -05:00
2021-03-03 15:13:24 +13:00
describe('snakeCase', () => {
test('works with simple lowercased phrases', () => {
2017-08-25 14:16:42 -05:00
expect(snakeCase('hello world')).toEqual('hello_world');
});
2021-03-03 15:13:24 +13:00
test.skip('works with Caps and punctuation', () => {
2017-08-25 14:16:42 -05:00
expect(snakeCase('Hello, World???')).toEqual('hello_world');
});
2021-03-03 15:13:24 +13:00
test.skip('works with longer phrases', () => {
2017-08-25 14:16:42 -05:00
expect(snakeCase('This is the song that never ends....')).toEqual('this_is_the_song_that_never_ends');
});
2021-03-03 15:13:24 +13:00
test.skip('works with camel case', () => {
2017-08-25 14:16:42 -05:00
expect(snakeCase('snakeCase')).toEqual('snake_case');
});
2021-03-03 15:13:24 +13:00
test.skip('works with kebab case', () => {
2017-08-25 14:16:42 -05:00
expect(snakeCase('snake-case')).toEqual('snake_case');
});
2021-03-03 15:13:24 +13:00
test.skip('works with WTF case', () => {
2017-08-25 14:16:42 -05:00
expect(snakeCase('SnAkE..CaSe..Is..AwEsOmE')).toEqual('snake_case_is_awesome');
});
});