UNPKG

base-domain

Version:

simple module to help build Domain-Driven Design

54 lines (22 loc) 1.12 kB
Util = require '../../src/lib/util' describe 'Util', -> describe 'camelize', -> it 'converts larry-carlton to LarryCarlton', -> cameled = Util.camelize('larry-carlton') expect(cameled).to.equal 'LarryCarlton' it 'converts get-element-by-id to getElementById when lowerFirst is true', -> cameled = Util.camelize('get-element-by-id', true) expect(cameled).to.equal 'getElementById' describe 'hyphenize', -> it 'converts CureApp to cure-app', -> hyphenized = Util.hyphenize('CureApp') expect(hyphenized).to.equal 'cure-app' it 'converts getElementById to get-element-by-id', -> hyphenized = Util.hyphenize('getElementById') expect(hyphenized).to.equal 'get-element-by-id' it 'converts Room335 to room335', -> hyphenized = Util.hyphenize('Room335') expect(hyphenized).to.equal 'room335' it 'converts WBC to w-b-c', -> hyphenized = Util.hyphenize('WBC') expect(hyphenized).to.equal 'w-b-c'