Skip to content

Commit 422f9da

Browse files
committed
test(schema): add coverage for calling plugin() with options
Fix #12077
1 parent 2262a77 commit 422f9da

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/schema.test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,19 @@ describe('schema', function() {
924924

925925
assert.equal(called, true);
926926
});
927+
928+
it('options param (gh-12077)', function() {
929+
const Tobi = new Schema();
930+
let called = false;
931+
932+
Tobi.plugin(function(schema, opts) {
933+
assert.equal(schema, Tobi);
934+
assert.deepStrictEqual(opts, { answer: 42 });
935+
called = true;
936+
}, { answer: 42 });
937+
938+
assert.equal(called, true);
939+
});
927940
});
928941

929942
describe('options', function() {

0 commit comments

Comments
 (0)