Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Jul 14, 2021
1 parent 4e1ee9b commit 7c865f4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions 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() {
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 7c865f4

Please sign in to comment.