Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2025-02-03 17:20:53 +00:00
parent 3e913ef09d
commit 9660df3fcc
990 changed files with 74805 additions and 60149 deletions

View file

@ -2,36 +2,39 @@
import fs from 'fs';
import path from 'path';
import expect from 'expect';
import test from 'tape';
import plugin from '../src';
const rules = fs.readdirSync(path.resolve(__dirname, '../src/rules/'))
.map((f) => path.basename(f, '.js'));
describe('all rule files should be exported by the plugin', () => {
test('all rule files should be exported by the plugin', (t) => {
rules.forEach((ruleName) => {
it(`should export ${ruleName}`, () => {
expect(plugin.rules[ruleName]).toEqual(
require(path.join('../src/rules', ruleName)) // eslint-disable-line
);
});
t.equal(
plugin.rules[ruleName],
require(path.join('../src/rules', ruleName)), // eslint-disable-line import/no-dynamic-require
`exports ${ruleName}`,
);
});
t.end();
});
describe('configurations', () => {
it('should export a \'recommended\' configuration', () => {
expect(plugin.configs.recommended).toBeDefined();
});
test('configurations', (t) => {
t.notEqual(plugin.configs.recommended, undefined, 'exports a \'recommended\' configuration');
t.end();
});
describe('schemas', () => {
test('schemas', (t) => {
rules.forEach((ruleName) => {
it(`${ruleName} should export a schema with type object`, () => {
const rule = require(path.join('../src/rules', ruleName)); // eslint-disable-line
const schema = rule.meta && rule.meta.schema && rule.meta.schema[0];
const { type } = schema;
const rule = require(path.join('../src/rules', ruleName)); // eslint-disable-line import/no-dynamic-require
const schema = rule.meta && rule.meta.schema && rule.meta.schema[0];
const { type } = schema;
expect(type).toEqual('object');
});
t.equal(type, 'object', `${ruleName} exports a schema with type object`);
});
t.end();
});