'use strict';

// MODULES //

var tape = require( 'tape' );
var RuleTester = require( 'eslint' ).RuleTester;
var rule = require( './../lib' );


// FIXTURES //

var valid = require( './fixtures/valid.js' );
var invalid = require( './fixtures/invalid.js' );
var unvalidated = require( './fixtures/unvalidated.js' );


// TESTS //

tape( 'main export is an object', function test( t ) {
	t.ok( true, __filename );
	t.equal( typeof rule, 'object', 'main export is an object' );
	t.end();
});

tape( 'the function positively validates code with JSDoc descriptions that do not contain Markdown lint errors', function test( t ) {
	var tester = new RuleTester();

	try {
		tester.run( 'jsdoc-no-heading-indent', rule, {
			'valid': valid,
			'invalid': []
		});
		t.pass( 'passed without errors' );
	} catch ( err ) {
		t.fail( 'encountered an error: ' + err.message );
	}
	t.end();
});

tape( 'the function negatively validates code with JSDoc descriptions that contain Markdown lint errors', function test( t ) {
	var tester = new RuleTester();

	try {
		tester.run( 'jsdoc-no-heading-indent', rule, {
			'valid': [],
			'invalid': invalid
		});
		t.pass( 'passed without errors' );
	} catch ( err ) {
		t.fail( 'encountered an error: ' + err.message );
	}
	t.end();
});

tape( 'the function does not validate non-JSDoc comments', function test( t ) {
	var tester = new RuleTester();

	try {
		tester.run( 'jsdoc-no-heading-indent', rule, {
			'valid': unvalidated,
			'invalid': []
		});
		t.pass( 'passed without errors' );
	} catch ( err ) {
		t.fail( 'encountered an error: ' + err.message );
	}
	t.end();
});


'use strict';

// MODULES //

var tape = require( 'tape' );
var RuleTester = require( 'eslint' ).RuleTester;
var rule = require( './../lib' );


// FIXTURES //

var valid = require( './fixtures/valid.js' );
var invalid = require( './fixtures/invalid.js' );
var unvalidated = require( './fixtures/unvalidated.js' );


// TESTS //

tape( 'main export is an object', function test( t ) {
	t.ok( true, __filename );
	t.equal( typeof rule, 'object', 'main export is an object' );
	t.end();
});

tape( 'the function positively validates code with JSDoc descriptions that do not contain Markdown lint errors', function test( t ) {
	var tester = new RuleTester();

	try {
		tester.run( 'jsdoc-no-heading-content-indent', rule, {
			'valid': valid,
			'invalid': []
		});
		t.pass( 'passed without errors' );
	} catch ( err ) {
		t.fail( 'encountered an error: ' + err.message );
	}
	t.end();
});

tape( 'the function negatively validates code with JSDoc descriptions that contain Markdown lint errors', function test( t ) {
	var tester = new RuleTester();

	try {
		tester.run( 'jsdoc-no-heading-content-indent', rule, {
			'valid': [],
			'invalid': invalid
		});
		t.pass( 'passed without errors' );
	} catch ( err ) {
		t.fail( 'encountered an error: ' + err.message );
	}
	t.end();
});

tape( 'the function does not validate non-JSDoc comments', function test( t ) {
	var tester = new RuleTester();

	try {
		tester.run( 'jsdoc-no-heading-content-indent', rule, {
			'valid': unvalidated,
			'invalid': []
		});
		t.pass( 'passed without errors' );
	} catch ( err ) {
		t.fail( 'encountered an error: ' + err.message );
	}
	t.end();
});


Fix package name in tests