diff --git a/src/test/configs_test.ts b/src/test/configs_test.ts index 9b8f96d..c39954c 100644 --- a/src/test/configs_test.ts +++ b/src/test/configs_test.ts @@ -1,38 +1,22 @@ -import {Linter} from 'eslint'; +import type {ESLint, Linter} from 'eslint'; import {expect} from 'chai'; import {configs} from '../index'; -describe('configs', () => { - it('should load flat configs correctly', () => { - const linter = new Linter({ - configType: 'flat' - }); - - const result = linter.verify( - 'html``', - [ - { - files: ['*.js'], - ...configs['flat/recommended'] - } - ], - 'foo.js' - ); +type ConfigLike = Linter.FlatConfig | ESLint.ConfigData; - expect(result.length).to.equal(1); - }); +const isFlatConfig = (config: ConfigLike): config is Linter.FlatConfig => + !Array.isArray(config.plugins); - it('should load legacy configs correctly', () => { - const linter = new Linter(); - - const result = linter.verify( - 'html``', - { - extends: ['plugin:lit/recommended'] - }, - 'foo.js' - ); +describe('configs', () => { + it('should define configs correctly', () => { + expect(configs['recommended']).to.be.ok; + expect(configs['all']).to.be.ok; + expect(configs['flat/recommended']).to.be.ok; + expect(configs['flat/all']).to.be.ok; - expect(result.length).to.equal(1); + expect(isFlatConfig(configs['flat/recommended'])).to.equal(true); + expect(isFlatConfig(configs['flat/all'])).to.equal(true); + expect(isFlatConfig(configs['recommended'])).to.equal(false); + expect(isFlatConfig(configs['all'])).to.equal(false); }); });