This repository has been archived on 2026-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
nyx/node_modules/speakingurl/test/test-titlecase.js
Nico e2667f8e12 Initial nyx project — fork of hermes-frontend
Forked from hermes-frontend, stripped openclaw/bun specifics:
- Auth tokens: openclaw_session -> nyx_session
- Vite proxy: localhost:3003 -> localhost:8000 (assay)
- Prod WS: wss://assay.loop42.de/ws
- Workspace paths: removed openclaw-specific paths
- Added missing deps: @heroicons/vue, overlayscrollbars-vue
- Branding: title -> nyx

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:23:27 +02:00

69 lines
1.8 KiB
JavaScript

/* global describe,it */
var getSlug = require('../lib/speakingurl');
describe('getSlug titleCase', function () {
'use strict';
it('should title-case the characters', function (done) {
getSlug('This is big foo', {
titleCase: true
})
.should.eql('This-Is-Big-Foo');
getSlug('This is Big foo', {
titleCase: true
})
.should.eql('This-Is-Big-Foo');
getSlug('Don\'t drink and drive', {
titleCase: true
})
.should.eql('Don-t-Drink-And-Drive');
done();
});
it('should title-case the characters with custom array', function (done) {
getSlug('This is yet foo and bar', {
titleCase: ['and', 'yet']
})
.should.eql('This-Is-yet-Foo-and-Bar');
getSlug('This is a foo and an angry bird', {
titleCase: ['a', 'an', 'and']
})
.should.eql('This-Is-a-Foo-and-an-Angry-Bird');
getSlug('This is a foo and an angry bird show', {
titleCase: ['a']
})
.should.eql('This-Is-a-Foo-And-An-Angry-Bird-Show');
getSlug('Don\'t drink and drive', {
titleCase: ['and']
})
.should.eql('Don-t-Drink-and-Drive');
getSlug('Don\'t drink and drive', {
titleCase: {}
})
.should.eql('Don-t-Drink-And-Drive');
getSlug('Don\'t drink and drive', {
titleCase: {
'drink': 'drive'
}
})
.should.eql('Don-t-Drink-And-Drive');
getSlug('Don\'t drink and drive', {
titleCase: 42
})
.should.eql('Don-t-Drink-And-Drive');
done();
});
});