wraith/node_modules/speakingurl/test/test-titlecase.js
Vantz Stockwell 2848d79915 feat: Phase 1 complete — Tauri v2 foundation
Rust backend: SQLite (WAL mode, 8 tables), vault encryption
(Argon2id + AES-256-GCM), settings/connections/credentials
services, 19 Tauri command wrappers. 46/46 tests passing.

Vue 3 frontend: unlock/create vault flow, Pinia app store,
Tailwind CSS v4 dark theme with Wraith branding.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 15:09:41 -04: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();
});
});