UNPKG

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