Skip to content

Commit

Permalink
changes on index.test.ts after review
Browse files Browse the repository at this point in the history
  • Loading branch information
vdiez committed Nov 28, 2024
1 parent 87fa9e6 commit e4c4f53
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/jsts/tests/rules/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { rules as tsEslintRules } from '../../src/rules/external/typescript-esli
import { rules as importRules } from 'eslint-plugin-import';
import { rules as reactHooksRules } from 'eslint-plugin-react-hooks';

const allRules = {
const allExternalRules = {
eslint: key => getESLintCoreRule(key),
'typescript-eslint': key => tsEslintRules[key],
'jsx-a11y': key => a11yRules[key],
Expand Down Expand Up @@ -77,14 +77,17 @@ describe('Plugin public API', () => {
} else if (metadata.implementation === 'external') {
expect(externalPlugins).toContain(metadata.externalPlugin);
expect(usedExternalEslintIds).not.toContain(metadata.eslintId);
expect(allExternalRules[metadata.externalPlugin](metadata.eslintId)).toBeDefined();
usedExternalEslintIds.push(metadata.eslintId);
} else if (metadata.implementation === 'decorated') {
expect(metadata.externalRules.length).toBeGreaterThan(0);
metadata.externalRules.forEach(externalRule => {
expect(usedExternalEslintIds).not.toContain(externalRule.externalRule);
usedExternalEslintIds.push(externalRule.externalRule);
expect(externalPlugins).toContain(externalRule.externalPlugin);
expect(allRules[externalRule.externalPlugin](externalRule.externalRule)).toBeDefined();
expect(
allExternalRules[externalRule.externalPlugin](externalRule.externalRule),
).toBeDefined();
});
}
}
Expand Down

0 comments on commit e4c4f53

Please sign in to comment.