提交学习笔记专用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
749 B

  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. });