Skip to content

Commit

Permalink
test(schema): add coverage for calling plugin() with options
Browse files Browse the repository at this point in the history
Fix #12077
  • Loading branch information
vkarpov15 committed Jul 20, 2022
1 parent 2262a77 commit 422f9da
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/schema.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,19 @@ describe('schema', function() {

assert.equal(called, true);
});

it('options param (gh-12077)', function() {
const Tobi = new Schema();
let called = false;

Tobi.plugin(function(schema, opts) {
assert.equal(schema, Tobi);
assert.deepStrictEqual(opts, { answer: 42 });
called = true;
}, { answer: 42 });

assert.equal(called, true);
});
});

describe('options', function() {
Expand Down

0 comments on commit 422f9da

Please sign in to comment.