This commit is contained in:
2025-05-12 05:38:44 +09:00
parent dced21c3f8
commit 6d78bfa46e
8120 changed files with 1161564 additions and 0 deletions

29
book/node_modules/github-slugid/test/test.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
var slug = require('../');
var should = require('should');
var MATCHES = {
'hello': 'hello',
'hello world': 'hello-world',
'!weird + id/for headings': 'weird--idfor-heading',
'您好': '您好',
'I ♥ you': 'i--you',
'a > b': 'a--b',
'Schöner Titel läßt grüßen!? Bel été !': 'schöner-titel-läßt-grüßen-bel-été-'
}
describe('slug', function () {
for (var value in MATCHES) {
var expected = MATCHES[value];
it('should handle '+ JSON.stringify(value), function() {
slug(value).should.equal(expected);
});
it('should handle '+ JSON.stringify(expected), function() {
slug(expected).should.equal(expected);
});
}
});