Skip to content

Commit

Permalink
tests: add tests for cli plugin resolver (#2194)
Browse files Browse the repository at this point in the history
  • Loading branch information
anshumanv committed Dec 7, 2020
1 parent 6cf6e4c commit 12edbe3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/webpack-cli/__tests__/CLIPluginResolver.test.js
@@ -0,0 +1,19 @@
const webpackCLI = require('../lib/webpack-cli');
const CLIPlugin = require('../lib/plugins/CLIPlugin');

const CLIPluginResolver = new webpackCLI().resolveCLIPlugin;

describe('CLIPluginResolver', () => {
it('should add CLI plugin to single compiler object', async () => {
const result = await CLIPluginResolver({ options: {} }, { hot: true, prefetch: true });
expect(result.options.plugins[0] instanceof CLIPlugin).toBeTruthy();
expect(result.options.plugins[0].options).toEqual({
configPath: undefined,
helpfulOutput: true,
hot: true,
progress: undefined,
prefetch: true,
analyze: undefined,
});
});
});

0 comments on commit 12edbe3

Please sign in to comment.