-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtests.js
More file actions
36 lines (29 loc) · 1.32 KB
/
tests.js
File metadata and controls
36 lines (29 loc) · 1.32 KB
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
/* global describe, it */
'use strict';
var assert = require('assert');
var gutil = require('gulp-util');
var expect = require('chai').expect;
var gulpHypher = require('./');
var hyphenation_pattern = require('hyphenation.en-gb');
describe('gulp-hypher', function() {
it('should ', function (cb) {
var stream = gulpHypher(hyphenation_pattern);
var html = '<p>Council leaders have called on the government to provide more resources to help them house extra refugees that the UK is planning to accept.</p>'
+ '<p>Also test HTML entities</p>'
+ '<p>dagger -> † <br>kappa -> κ <br>omicron -> ο <br> lt -> < <br> ã -> ã</p>';
var result = '<p>Coun\u00ADcil lead\u00ADers have called on the gov\u00ADern\u00ADment to provide more re\u00ADsources to help them house ex\u00ADtra refugees that the UK is plan\u00ADning to ac\u00ADcept.</p>'
+ '<p>Also test HTML en\u00ADtit\u00ADies</p>'
+ '<p>dag\u00ADger -> † <br>kappa -> κ <br>omic\u00ADron -> ο <br> lt -> < <br> ã -> ã</p>';
var file = new gutil.File({
base: __dirname,
path: __dirname + '/test.html',
contents: new Buffer(html)
});
stream.on('data', function (file) {
expect(file.contents.toString()).to.equal(result);
});
stream.on('end', cb);
stream.write(file);
stream.end();
});
});