UNPKG

726 BJavaScriptView Raw
1import { closeNonPairedParens, stripNonPairedParens, repeat } from './AsYouTypeFormatter.util'
2
3describe('closeNonPairedParens', () => {
4 it('should close non-paired braces', () => {
5 closeNonPairedParens('(000) 123-45 (9 )', 15).should.equal('(000) 123-45 (9 )')
6 })
7})
8
9describe('stripNonPairedParens', () => {
10 it('should strip non-paired braces', () => {
11 stripNonPairedParens('(000) 123-45 (9').should.equal('(000) 123-45 9')
12 stripNonPairedParens('(000) 123-45 (9)').should.equal('(000) 123-45 (9)')
13 })
14})
15
16describe('repeat', () => {
17 it('should repeat string N times', () => {
18 repeat('a', 0).should.equal('')
19 repeat('a', 3).should.equal('aaa')
20 repeat('a', 4).should.equal('aaaa')
21 })
22})
\No newline at end of file