test-maintaincase.js 749 B

1234567891011121314151617181920212223242526272829303132
  1. /* global describe,it */
  2. var getSlug = require('../lib/speakingurl');
  3. describe('getSlug maintainCase', function () {
  4. 'use strict';
  5. it('should maintain case characters', function (done) {
  6. getSlug('Foo, Bar Baz', {
  7. maintainCase: true
  8. })
  9. .should.eql('Foo-Bar-Baz');
  10. getSlug('Foo- Bar Baz', {
  11. maintainCase: true
  12. })
  13. .should.eql('Foo-Bar-Baz');
  14. getSlug('Foo] Bar Baz', {
  15. maintainCase: true
  16. })
  17. .should.eql('Foo-Bar-Baz');
  18. getSlug('Foo > Bar ♥ Baz', {
  19. maintainCase: true
  20. })
  21. .should.eql('Foo-greater-than-Bar-love-Baz');
  22. done();
  23. });
  24. });