forked from jonathantneal/mdcss-theme-github
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.js
27 lines (22 loc) · 805 Bytes
/
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
var mdcss = require('mdcss');
var fs = require('fs');
var path = require('path');
var plugin = require('./');
var test = require('tape');
test('mdcss-theme-github', function (t) {
t.plan(1);
var message = 'Test mdcss GitHub';
var options = { theme: plugin({ title: 'GitHub Theme', color: '#222222', nav: [{ name: 'mdcss', url: 'http://github.com/jonathantneal/mdcss' }] }), destination: 'demo' };
var warning = 0;
var warningMsg = message + ' (# of warnings)';
var inputPath = path.resolve('assets/style.css');
var inputCSS = '';
try {
inputCSS = fs.readFileSync(inputPath, 'utf8');
} catch (error) {
fs.writeFileSync(inputPath, inputCSS);
}
mdcss.process(inputCSS, options).then(function (result) {
t.equal(result.warnings().length, warning, warningMsg);
});
});