From 4fef163e5b717c0412ab9420272b0fcbc1eb8f56 Mon Sep 17 00:00:00 2001 From: ssube Date: Fri, 15 Nov 2019 19:25:29 -0600 Subject: [PATCH] cover rule visitor's extraneous pick method --- test/rule/TestRule.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/rule/TestRule.ts b/test/rule/TestRule.ts index 53a12e9..fe62f3f 100644 --- a/test/rule/TestRule.ts +++ b/test/rule/TestRule.ts @@ -250,6 +250,22 @@ describeLeaks('rule visitor', async () => { expect(visitStub).to.have.callCount(3); expect(ctx.errors.length).to.equal(3); }); + + itLeaks('should not pick items', async () => { + const ctx = new VisitorContext({ + logger: NullLogger.global, + schemaOptions: { + coerce: false, + defaults: false, + mutate: false, + }, + }); + const visitor = new RuleVisitor({ + rules: [], + }); + + return expect(visitor.pick(ctx, {})).to.eventually.deep.equal([]); + }); }); describe('create rule sources helper', () => {