diff --git a/src/visitor/VisitorContext.ts b/src/visitor/VisitorContext.ts index 061eb93..eac1372 100644 --- a/src/visitor/VisitorContext.ts +++ b/src/visitor/VisitorContext.ts @@ -1,6 +1,6 @@ import Ajv from 'ajv'; import { JSONPath } from 'jsonpath-plus'; -import { Logger, logWithLevel } from 'noicejs'; +import { Logger } from 'noicejs'; import { doesExist, hasItems } from '../utils'; import { VisitorError } from './VisitorError'; @@ -63,14 +63,6 @@ export class VisitorContext implements VisitorContextOptions, VisitorResult { return this.ajv.compile(schema); } - public error(...errors: Array) { - for (const err of errors) { - logWithLevel(this.logger, err.level, err.data, err.msg); - } - - this.errorBuffer.push(...errors); - } - public mergeResult(other: VisitorResult): this { this.changeBuffer.push(...other.changes); this.errorBuffer.push(...other.errors); diff --git a/test/rule/TestRule.ts b/test/rule/TestRule.ts index 4f09f55..58123de 100644 --- a/test/rule/TestRule.ts +++ b/test/rule/TestRule.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; import { ConsoleLogger } from 'noicejs'; -import { mock, spy } from 'sinon'; +import { mock } from 'sinon'; import { createRuleSelector, resolveRules, visitRules } from '../../src/rule'; import { SchemaRule } from '../../src/rule/SchemaRule'; @@ -203,7 +203,6 @@ describeLeaks('rule visitor', async () => { }, logger: new ConsoleLogger(), }); - const errorSpy = spy(ctx, 'error'); const data = { foo: 3, @@ -227,6 +226,5 @@ describeLeaks('rule visitor', async () => { const results = await rule.visit(ctx, data); expect(results.errors.length).to.equal(0); - expect(errorSpy).to.have.callCount(0); }); });