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

27 lines
872 B
JavaScript
Raw Normal View History

const snakeCase = require('./snakeCase')
2017-08-25 12:16:42 -07:00
describe("snakeCase", function () {
it("works with simple lowercased phrases", function () {
2017-12-15 11:26:05 -08:00
expect(snakeCase("hello world")).toEqual("hello_world");
2017-08-25 12:16:42 -07:00
});
xit("works with Caps and punctuation", function () {
2017-12-15 11:26:05 -08:00
expect(snakeCase("Hello, World???")).toEqual("hello_world");
2017-08-25 12:16:42 -07:00
});
xit("works with longer phrases", function () {
2017-12-15 11:26:05 -08:00
expect(snakeCase("This is the song that never ends....")).toEqual(
"this_is_the_song_that_never_ends"
);
2017-08-25 12:16:42 -07:00
});
xit("works with camel case", function () {
2017-12-15 11:26:05 -08:00
expect(snakeCase("snakeCase")).toEqual("snake_case");
2017-08-25 12:16:42 -07:00
});
xit("works with kebab case", function () {
2017-12-15 11:26:05 -08:00
expect(snakeCase("snake-case")).toEqual("snake_case");
2017-08-25 12:16:42 -07:00
});
xit("works with WTF case", function () {
2017-12-15 11:26:05 -08:00
expect(snakeCase("SnAkE..CaSe..Is..AwEsOmE")).toEqual(
"snake_case_is_awesome"
);
2017-08-25 12:16:42 -07:00
});
});