Skip to content

Commit

Permalink
Merge pull request #4 from ssbc/new-fixtures-fix
Browse files Browse the repository at this point in the history
Adjust tests to new fixtures
  • Loading branch information
Powersource authored Jan 24, 2024
2 parents 1df163d + 89cf8a1 commit 030432d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ test('exact chain-of-words', (t) => {
pull.filter((msg) => msg.value.content.text.toLowerCase().includes(INPUT)),
pull.collect((err, msgs) => {
t.error(err, 'no error');
t.equals(msgs.length, 4, 'four posts');
t.equals(msgs.length, 2, 'two posts');
sbot.close(true, t.end);
}),
);
Expand All @@ -91,9 +91,9 @@ test('word prefix', (t) => {
t.false(/\blabo\b/i.test(msg.value.content.text), 'labo is not found');
const matches = [...msg.value.content.text.matchAll(/labo/gi)];
t.true(msg.value.content.text.includes('labo'), 'labo prefix is found');
t.equals(matches.length, 3, '3 matches');
t.equals(matches.length, 2, '2 matches');
const matchPositions = matches.map((m) => m.index);
t.deepEquals(matchPositions, [47, 55, 168], 'labo positions found');
t.deepEquals(matchPositions, [160, 168], 'labo positions found');
setTimeout(()=> {
sbot.close(true, t.end);
},1000)
Expand Down

0 comments on commit 030432d

Please sign in to comment.