Skip to content

Commit bfbac9f

Browse files
committed
Fix tests
1 parent 0deda45 commit bfbac9f

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

test/index.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,18 @@ test('nlcst-affix-emoticon-modifier()', function (t) {
4949

5050
/* Short-cut to access the CST. */
5151
function process(fixture, positionless) {
52-
var processor = unified().use(english).use(plugin);
53-
return processor.run(processor.parse(fixture, {position: !positionless}));
52+
var processor = unified().use(english).use(plugin).freeze();
53+
54+
if (positionless) {
55+
processor.Parser.prototype.position = false;
56+
}
57+
58+
return processor.runSync(processor.parse(fixture));
5459
}
5560

5661
/* Add modifier to processor. */
57-
function plugin(processor) {
58-
processor.Parser.prototype.useFirst('tokenizeSentence', emojiModifier);
59-
processor.Parser.prototype.useFirst('tokenizeSentence', emoticonModifier);
60-
processor.Parser.prototype.useFirst('tokenizeParagraph', modifier);
62+
function plugin() {
63+
this.Parser.prototype.useFirst('tokenizeSentence', emojiModifier);
64+
this.Parser.prototype.useFirst('tokenizeSentence', emoticonModifier);
65+
this.Parser.prototype.useFirst('tokenizeParagraph', modifier);
6166
}

0 commit comments

Comments
 (0)