1 |
|
2 | var assert = require('chai').assert;
|
3 | var CallHelpers = require('../lib/call_helpers');
|
4 |
|
5 | describe("CallHelpers", function() {
|
6 | describe("applyWrappers", function() {
|
7 | it("should apply array wrappers", function() {
|
8 | assert.equal(
|
9 | CallHelpers.applyWrappers(
|
10 | "*hello* ***bob*** **lol**",
|
11 | ["<b>$1</b>", "<em>$1</em>", "<i>$1</i>"]
|
12 | ),
|
13 | "<b>hello</b> <i>bob</i> <em>lol</em>"
|
14 | );
|
15 | });
|
16 |
|
17 | it("should apply object wrappers", function() {
|
18 | assert.equal(
|
19 | CallHelpers.applyWrappers(
|
20 | "*hello* ***bob*** **lol**",
|
21 | {"*": "<b>$1</b>", "**": "<em>$1</em>", "***": "<i>$1</i>"}
|
22 | ),
|
23 | "<b>hello</b> <i>bob</i> <em>lol</em>"
|
24 | );
|
25 | });
|
26 | });
|
27 | });
|
28 |
|
29 |
|