text: import { webpack, evaluated } from './helpers';
  
  describe('localsConvention option', () => {
    it('not specified', async () => {
      const config = { loader: { options: { modules: true } } };
      const testId = './modules/localsConvention.css';
      const stats = await webpack(testId, config);
      const { modules } = stats.toJson();
      const module = modules.find((m) => m.id === testId);
      const evaluatedModule = evaluated(module.source);
  
      expect(evaluatedModule).toMatchSnapshot('module (evaluated)');
      expect(evaluatedModule.locals).toMatchSnapshot('locals');
      expect(stats.compilation.warnings).toMatchSnapshot('warnings');
      expect(stats.compilation.errors).toMatchSnapshot('errors');
    });
  
    it('asIs', async () => {
      const config = {
        loader: {
          options: {
            modules: true,
            localsConvention: 'asIs',
          },
        },
      };
      const testId = './modules/localsConvention.css';
      const stats = await webpack(testId, config);
      const { modules } = stats.toJson();
      const module = modules.find((m) => m.id === testId);
      const evaluatedModule = evaluated(module.source);
  
      expect(evaluatedModule).toMatchSnapshot('module (evaluated)');
      expect(evaluatedModule.locals).toMatchSnapshot('locals');
      expect(stats.compilation.warnings).toMatchSnapshot('warnings');
      expect(stats.compilation.errors).toMatchSnapshot('errors');
    });
  
    it('camelCase', async () => {
      const config = {
        loader: {
          options: {
            modules: true,
            localsConvention: 'camelCase',
          },
        },
      };
      const testId = './modules/localsConvention.css';
      const stats = await webpack(testId, config);
      const { modules } = stats.toJson();
      const module = modules.find((m) => m.id === testId);
      const evaluatedModule = evaluated(module.source);
  
      expect(evaluatedModule).toMatchSnapshot('module (evaluated)');
      expect(evaluatedModule.locals).toMatchSnapshot('locals');
      expect(stats.compilation.warnings).toMatchSnapshot('warnings');
      expect(stats.compilation.errors).toMatchSnapshot('errors');
    });
  
    it('camelCaseOnly', async () => {
      const config = {
        loader: {
          options: {
            modules: true,
            localsConvention: 'camelCaseOnly',
          },
        },
      };
      const testId = './modules/localsConvention.css';
      const stats = await webpack(testId, config);
      const { modules } = stats.toJson();
      const module = modules.find((m) => m.id === testId);
      const evaluatedModule = evaluated(module.source);
  
      expect(evaluatedModule).toMatchSnapshot('module (evaluated)');
      expect(evaluatedModule.locals).toMatchSnapshot('locals');
      expect(stats.compilation.warnings).toMatchSnapshot('warnings');
      expect(stats.compilation.errors).toMatchSnapshot('errors');
    });
  
    it('dashes', async () => {
      const config = {
        loader: {
          options: {
            modules: true,
            localsConvention: 'dashes',
          },
        },
      };
      const testId = './modules/localsConvention.css';
      const stats = await webpack(testId, config);
      const { modules } = stats.toJson();
      const module = modules.find((m) => m.id === testId);
      const evaluatedModule = evaluated(module.source);
  
      expect(evaluatedModule).toMatchSnapshot('module (evaluated)');
      expect(evaluatedModule.locals).toMatchSnapshot('locals');
      expect(stats.compilation.warnings).toMatchSnapshot('warnings');
      expect(stats.compilation.errors).toMatchSnapshot('errors');
    });
  
    it('dashesOnly', async () => {
      const config = {
        loader: {
          options: {
            modules: true,
            localsConvention: 'dashesOnly',
          },
        },
      };
      const testId = './modules/localsConvention.css';
      const stats = await webpack(testId, config);
      const { modules } = stats.toJson();
      const module = modules.find((m) => m.id === testId);
      const evaluatedModule = evaluated(module.source);
  
      expect(evaluatedModule).toMatchSnapshot('module (evaluated)');
      expect(evaluatedModule.locals).toMatchSnapshot('locals');
      expect(stats.compilation.warnings).toMatchSnapshot('warnings');
      expect(stats.compilation.errors).toMatchSnapshot('errors');
    });
  });
  