You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
850 B

4 years ago
  1. import OptimizeCssAssetsPlugin from '../src/';
  2. describe('plugin test', () => {
  3. it('does not throw when called', () => {
  4. expect(() => {
  5. new OptimizeCssAssetsPlugin();
  6. }).not.toThrow();
  7. });
  8. it('can override default parameters', () => {
  9. const assetNameRegExp = /\.optimize\.css$/
  10. const cssProcessor = {};
  11. const cssProcessorOptions = { discardComments: { removeAll: true } };
  12. const canPrint = false;
  13. const plugin = new OptimizeCssAssetsPlugin({
  14. assetNameRegExp,
  15. cssProcessor,
  16. cssProcessorOptions,
  17. canPrint
  18. });
  19. expect(plugin.options.assetNameRegExp).toEqual(assetNameRegExp);
  20. expect(plugin.options.cssProcessor).toEqual(cssProcessor);
  21. expect(plugin.options.cssProcessorOptions).toEqual(cssProcessorOptions);
  22. expect(plugin.options.canPrint).toEqual(canPrint);
  23. });
  24. });