GoScrobble/web/node_modules/optimize-css-assets-webpack-plugin/test/plugin.test.js

27 lines
850 B
JavaScript
Raw Permalink Normal View History

2022-04-25 02:47:15 +00:00
import OptimizeCssAssetsPlugin from '../src/';
describe('plugin test', () => {
it('does not throw when called', () => {
expect(() => {
new OptimizeCssAssetsPlugin();
}).not.toThrow();
});
it('can override default parameters', () => {
const assetNameRegExp = /\.optimize\.css$/
const cssProcessor = {};
const cssProcessorOptions = { discardComments: { removeAll: true } };
const canPrint = false;
const plugin = new OptimizeCssAssetsPlugin({
assetNameRegExp,
cssProcessor,
cssProcessorOptions,
canPrint
});
expect(plugin.options.assetNameRegExp).toEqual(assetNameRegExp);
expect(plugin.options.cssProcessor).toEqual(cssProcessor);
expect(plugin.options.cssProcessorOptions).toEqual(cssProcessorOptions);
expect(plugin.options.canPrint).toEqual(canPrint);
});
});