How to use the tv4-reporter.getReporter function in tv4-reporter

To help you get started, we’ve selected a few tv4-reporter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / tsd / src / xm / lib / Koder.ts View on Github external
assert(value: T): void {
		assert(typeOf.isJSONValue(value), 'is not a JSON value {a}', value);
		if (this.schema) {
			// validate schema
			var res: TV4SingleResult = tv4.validateResult(value, this.schema);
			if (!res.valid || res.missing.length > 0) {
				var report = reporter.getReporter(log.out.getWrite(), log.out.getStyle());
				var test = report.createTest(this.schema, value, null, res, true);
				if (res.missing.length > 0) {
					report.reportMissing(test, '   ');
					throw new Error('missing schemas');
				}
				else {
					report.reportError(test, res.error, '   ', '   ');
					throw res.error;
				}
			}
		}
	}
github timbeadle / grunt-tv4 / tasks / tv4.js View on Github external
module.exports = function (grunt) {

	var out = miniwrite.grunt(grunt);
	var style = ministyle.grunt();
	var report = reporter.getReporter(out, style);
	var runner = runnerModule.getRunner(taskTv4, loader.getLoaders(), out, style);

	grunt.registerMultiTask('tv4', 'Validate values against json-schema v4.', function () {
		var done = this.async();

		//import options
		var context = runner.getContext(this.options(runner.getOptions({
			timeout: 5000
		})));
		var objects = [];

		if (context.options.fresh) {
			context.tv4 = taskTv4.freshApi();
		}
		else {
			context.tv4 = taskTv4;

tv4-reporter

Report Tiny Validator tv4 results in usable formats

MIT
Latest version published 8 months ago

Package Health Score

63 / 100
Full package analysis

Popular tv4-reporter functions