All files / src/rules missing-rule.spec.ts

100% Statements 9/9
100% Branches 0/0
100% Functions 3/3
100% Lines 9/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221x   1x   1x       1x 1x         1x 1x 1x 1x        
import HtmlValidate from '../htmlvalidate';
 
describe('missing rule', function(){
 
	const expect = require('chai').expect;
 
	let htmlvalidate: HtmlValidate;
 
	before(function(){
		htmlvalidate = new HtmlValidate({
			rules: {'foo': 'error'},
		});
	});
 
	it('should report error when rule is not defined', function(){
		const report = htmlvalidate.validateString('<p></p>');
		expect(report).to.be.invalid;
		expect(report).to.have.error('foo', 'Definition for rule \'foo\' was not found');
	});
 
});