From 519bb6a5d4fafc1762678646984e994d8b7757f4 Mon Sep 17 00:00:00 2001 From: Honza Machala Date: Mon, 8 Feb 2021 23:52:43 +0100 Subject: [PATCH] Add test for word boundaries (#127) Detection of word boundaries used hyphens as word boundaries instead of ignoring them. Fix was done in package `duereg/too-wordy` fixes: #112 --- test/basic.spec.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/basic.spec.js b/test/basic.spec.js index f747b12..3a01222 100644 --- a/test/basic.spec.js +++ b/test/basic.spec.js @@ -167,6 +167,12 @@ describe('writeGood', () => { it('should ignore white-listed words', () => { expect(writeGood('Never write read-only sentences.', { whitelist: ['read-only'] })).toEqual([]); }); + + it('should parse words boundaries with dash correctly', () => { + expect(writeGood('A transfer visa may be required at check-in between any connecting flight.')).toEqual([ + { index: 20, offset: 11, reason: '"be required" may be passive voice' } + ]); + }); }); describe('annotate', () => {