This repository has been archived by the owner on Jan 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
test.js
53 lines (45 loc) · 1.51 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
49
50
51
52
53
/**
* @author Adam Hollett and Jeremy Hanson-Finger
* @copyright 2016 Shopify
* @license ISC
* @module rorybot:test
* @fileoverview Test suite for rorybot.
*/
'use strict';
/* eslint-env node */
/*
* Dependencies.
*/
var test = require('ava');
var alex = require('./');
/*
* Tests. Note that these are small because alex is in fact
* just a collection of well-tested modules.
* See `wooorm/retext-equality` for the gist of what
* warnings are exposed.
*/
test('alex()', function (t) {
t.same(alex([
'The boogeyman wrote all changes to the **master server**. Thus,',
'the slaves were read-only copies of master. But not to worry,',
'he was a cripple.',
'',
'Eric is pretty set on beating your butt for sheriff.'
].join('\n')).messages.map(String), [
'1:5-1:14: `boogeyman` may be insensitive, use `boogey` instead',
'1:42-1:48: `master` / `slaves` may be insensitive, use ' +
'`primary` / `replica` instead',
'3:1-3:3: `he` may be insensitive, use `they`, `it` instead',
'3:10-3:17: `cripple` may be insensitive, use `person with a ' +
'limp` instead',
'5:36-5:40: Don’t use “butt”, it’s profane'
]);
});
test('alex.markdown()', function (t) {
t.same(alex.markdown('The `boogeyman`.').messages.map(String), []);
});
test('alex.text()', function (t) {
t.same(alex.text('The `boogeyman`.').messages.map(String), [
'1:6-1:15: `boogeyman` may be insensitive, use `boogey` instead'
]);
});