diff --git a/test/node-unit/cli/run-helpers.spec.js b/test/node-unit/cli/run-helpers.spec.js index e12b97b875..e56cdb2868 100644 --- a/test/node-unit/cli/run-helpers.spec.js +++ b/test/node-unit/cli/run-helpers.spec.js @@ -1,6 +1,7 @@ 'use strict'; const {validateLegacyPlugin, list} = require('../../../lib/cli/run-helpers'); +const Mocha = require('../../../lib/mocha'); describe('helpers', function() { describe('validateLegacyPlugin()', function() { @@ -56,6 +57,19 @@ describe('helpers', function() { }); }); + describe('when used with a third-party interface', function() { + it('should add the interface to "Mocha.interfaces"', function() { + // let's suppose that `glob` is an interface + validateLegacyPlugin( + {interface: 'glob'}, + 'interface', + Mocha.interfaces + ); + expect(Mocha.interfaces, 'to satisfy', {glob: require('glob')}); + delete Mocha.interfaces.glob; + }); + }); + describe('when a plugin throws an exception upon load', function() { it('should fail and report the original error', function() { expect(