index.js
function logResults(results) {
		const { violations, testEngine, testEnvironment, testRunner } = results;

		if (violations.length === 0) {
			cliReporter(colors.green('  0 violations found!'));
			return;
		}

		const issueCount = violations.reduce((count, violation) => {
			cliReporter(
				'\n' +
					error('  Violation of %j with %d occurrences!\n') +
					'    %s. Correct invalid elements at:\n' +
					violation.nodes
						.map(node => '     - ' + utils.selectorToString(node.target) + '\n')
						.join('') +
					'    For details, see: %s',
				violation.id,
				violation.nodes.length,
				violation.description,
				link(violation.helpUrl.split('?')[0])
			);
			return count + violation.nodes.length;
		}, 0);

		cliReporter(error('\n%d Accessibility issues detected.'), issueCount);

		if (program.verbose) {
			const metadata = {
				'Test Runner': testRunner,
				'Test Engine': testEngine,
				'Test Environment': testEnvironment
			};
			cliReporter(`\n${JSON.stringify(metadata, null, 2)}`);
		}

		if (program.exit) {
			process.exitCode = 1;
		}
	}
function logResults(results) {
		const { violations, testEngine, testEnvironment, testRunner } = results;

		if (violations.length === 0) {
			cliReporter(colors.green('  0 violations found!'));
			return;
		}

		const issueCount = violations.reduce((count, violation) => {
			cliReporter(
				'\n' +
					error('  Violation of %j with %d occurrences!\n') +
					'    %s. Correct invalid elements at:\n' +
					violation.nodes
						.map(node => '     - ' + utils.selectorToString(node.target) + '\n')
						.join('') +
					'    For details, see: %s',
				violation.id,
				violation.nodes.length,
				violation.description,
				link(violation.helpUrl.split('?')[0])
			);
			return count + violation.nodes.length;
		}, 0);

		cliReporter(error('\n%d Accessibility issues detected.'), issueCount);

		if (program.verbose) {
			const metadata = {
				'Test Runner': testRunner,
				'Test Engine': testEngine,
				'Test Environment': testEnvironment
			};
			cliReporter(`\n${JSON.stringify(metadata, null, 2)}`);
		}

		if (program.exit) {
			process.exitCode = 1;
		}
	}
function logResults ( results ) { const { violations , testEngine , testEnvironment , testRunner } = results ; if ( violations . length === 0 ) { cliReporter ( colors . green ( '  0 violations found!' ) ) ; return ; } const issueCount = violations . reduce ( ( count , violation ) => { cliReporter ( '\n' + error ( '  Violation of %j with %d occurrences!\n' ) + '    %s. Correct invalid elements at:\n' + violation . nodes . map ( node => '     - ' + utils . selectorToString ( node . target ) + '\n' ) . join ( '' ) + '    For details, see: %s' , violation . id , violation . nodes . length , violation . description , link ( violation . helpUrl . split ( '?' ) [ 0 ] ) ) ; return count + violation . nodes . length ; } , 0 ) ; cliReporter ( error ( '\n%d Accessibility issues detected.' ) , issueCount ) ; if ( program . verbose ) { const metadata = { 'Test Runner' : testRunner , 'Test Engine' : testEngine , 'Test Environment' : testEnvironment } ; cliReporter ( ` \n ${ JSON . stringify ( metadata , null , 2 ) } ` ) ; } if ( program . exit ) { process . exitCode = 1 ; } }
Put the result in the console
Put the result in the console