-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.js
48 lines (39 loc) · 1.09 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* @author Duncan Beaton
* @copyright 2016 Duncan Beaton
* @license MIT
* @module retext:cliches
* @fileoverview Check phrases cliches.
*/
'use strict';
/* eslint-env node */
/*
* Dependencies.
*/
var test = require('tape');
var retext = require('retext');
var cliches = require('./');
/*
* Tests.
*/
test('cliches', function (t) {
t.plan(2);
retext()
.use(cliches)
.process([
'You can use cliches until the until the cows come home.',
'Sorry to burst your bubble',
'but you will sound like a broken record.'
].join('\n'), function (err, file) {
t.ifError(err, 'should not fail (#1)');
t.deepEqual(
file.messages.map(String),
[
'1:31-1:55: Warning: “until the cows come home” is a cliche',
'2:10-2:27: Warning: “burst your bubble” is a cliche',
'3:27-3:40: Warning: “broken record” is a cliche'
],
'should warn about the use of cliches'
);
});
});