Skip to content

Add test coverage for bundlerUtils getCssExtractPlugin default case #683

@justin808

Description

@justin808

Missing Test Case

The getCssExtractPlugin function in bundlerUtils.js isn't tested for the default (webpack) case when assets_bundler is undefined.

Suggested Test

it('getCssExtractPlugin defaults to mini-css-extract-plugin when bundler undefined', () => {
  mockConfig.assets_bundler = undefined;
  jest.doMock('shakapacker', () => ({ config: mockConfig }));
  const utils = require('../../../config/webpack/bundlerUtils');
  
  const plugin = utils.getCssExtractPlugin();
  expect(plugin.name).toBe('MiniCssExtractPlugin');
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions