2021-04-30 02:49:46 -07:00
|
|
|
const snakeCase = require('./snakeCase')
|
2017-08-25 12:16:42 -07:00
|
|
|
|
2021-05-12 18:47:42 -07:00
|
|
|
describe("snakeCase", function () {
|
|
|
|
it("works with simple lowercased phrases", function () {
|
|
|
|
expect(snakeCase("hello world")).toEqual("hello_world");
|
2017-08-25 12:16:42 -07:00
|
|
|
});
|
2021-05-12 18:47:42 -07:00
|
|
|
xit("works with Caps and punctuation", function () {
|
|
|
|
expect(snakeCase("Hello, World???")).toEqual("hello_world");
|
2017-08-25 12:16:42 -07:00
|
|
|
});
|
2021-05-12 18:47:42 -07:00
|
|
|
xit("works with longer phrases", function () {
|
|
|
|
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
|
|
|
});
|
2021-05-12 18:47:42 -07:00
|
|
|
xit("works with camel case", function () {
|
|
|
|
expect(snakeCase("snakeCase")).toEqual("snake_case");
|
2017-08-25 12:16:42 -07:00
|
|
|
});
|
2021-05-12 18:47:42 -07:00
|
|
|
xit("works with kebab case", function () {
|
|
|
|
expect(snakeCase("snake-case")).toEqual("snake_case");
|
2017-08-25 12:16:42 -07:00
|
|
|
});
|
2021-05-12 18:47:42 -07:00
|
|
|
xit("works with WTF case", function () {
|
|
|
|
expect(snakeCase("SnAkE..CaSe..Is..AwEsOmE")).toEqual(
|
|
|
|
"snake_case_is_awesome"
|
|
|
|
);
|
2017-08-25 12:16:42 -07:00
|
|
|
});
|
|
|
|
});
|