Node-Red configuration
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

index.js 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. var assert = require('assert')
  2. var title = require('..')
  3. /**
  4. * Tests.
  5. */
  6. describe('to-title-case', function () {
  7. it('shouldnt touch title case', function () {
  8. assert.equal(title('A Title: Case of String'), 'A Title: Case of String')
  9. })
  10. it('should convert space case', function () {
  11. assert.equal(title('a space case of string'), 'A Space Case of String')
  12. })
  13. it('should convert camel case', function () {
  14. assert.equal(title('aCamelCaseOfString'), 'A Camel Case of String')
  15. })
  16. it('should convert snake case', function () {
  17. assert.equal(title('a_snake_case_of_string'), 'A Snake Case of String')
  18. })
  19. it('should convert dot case', function () {
  20. assert.equal(title('a.dot.case.of.string'), 'A Dot Case of String')
  21. })
  22. it('should convert constant case', function () {
  23. assert.equal(title('A_CONSTANT_CASE_OF_STRING'), 'A Constant Case of String')
  24. })
  25. it('should convert "the lord of the flies"', function () {
  26. assert.equal(title('the lord of the flies'), 'The Lord of the Flies')
  27. })
  28. it('should convert "a tale of two cities"', function () {
  29. assert.equal(title('a tale of two cities'), 'A Tale of Two Cities')
  30. })
  31. it('should convert "the lion, the witch and the wardrobe"', function () {
  32. assert.equal(title('the lion, the witch and the wardrobe'), 'The Lion, the Witch and the Wardrobe')
  33. })
  34. it('should convert "she: a history of adventure"', function () {
  35. assert.equal(title('she: a history of adventure'), 'She: A History of Adventure')
  36. })
  37. })