-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
41 lines (31 loc) · 877 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* eslint-env mocha */
/* eslint no-unused-expressions: off */
'use strict';
const expect = require('chai').expect;
const StylintPlugin = require('.');
describe('stylint-brunch', () => {
let plugin;
beforeEach(() => {
plugin = new StylintPlugin({
plugins: {},
});
});
it('should be an object', () => {
expect(plugin).to.be.an.instanceof(StylintPlugin);
});
it('should have #lint method', () => {
expect(plugin).to.respondTo('lint');
});
it('should lint a valid file and throw no errors', () => {
const filepath = './test.styl';
const data = 'h1 color: blue';
return plugin.lint(data, filepath);
});
it('should lint a invalid file and catch the error', () => {
const filepath = './test.styl';
const data = 'h1 color: blue;';
return plugin
.lint(data, filepath)
.catch(() => { });
});
});