-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathdamping.js
More file actions
35 lines (32 loc) · 906 Bytes
/
damping.js
File metadata and controls
35 lines (32 loc) · 906 Bytes
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
var read = require('../')
var chai = require('chai')
var expect = chai.expect
var should = chai.should()
describe('custom damping', function () {
var html = '<title>TIDY!!!!!</title><body><div><div><div><p>Hola!!!! Real Madrid!!!!!!!!!!!!!!</p></div></div><p>-Tjatse</p></div></body>'
describe('by default', function () {
it('will get no author', function (done) {
read({
html: html
}, function (err, art) {
should.not.exist(err)
expect(art).to.be.an('object')
art.content.should.not.contain('Tjatse')
done()
})
})
})
describe('by 2', function () {
it('will get author', function (done) {
read({
html: html,
damping: 2
}, function (err, art) {
should.not.exist(err)
expect(art).to.be.an('object')
art.content.should.contain('Tjatse')
done()
})
})
})
})