- Complete React app with 7 developer tools - JSON Tool with visual structured editor - Serialize Tool with visual structured editor - URL, Base64, CSV/JSON, Beautifier, Diff tools - Responsive navigation with dropdown menu - Dark/light mode toggle - Mobile-responsive design with sticky header - All tools working with copy/paste functionality
41 lines
1.0 KiB
JavaScript
41 lines
1.0 KiB
JavaScript
/* eslint global-require: 0 */
|
|
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
import test from 'tape';
|
|
|
|
import plugin from '../src';
|
|
|
|
const rules = fs.readdirSync(path.resolve(__dirname, '../src/rules/'))
|
|
.map((f) => path.basename(f, '.js'));
|
|
|
|
test('all rule files should be exported by the plugin', (t) => {
|
|
rules.forEach((ruleName) => {
|
|
t.equal(
|
|
plugin.rules[ruleName],
|
|
require(path.join('../src/rules', ruleName)), // eslint-disable-line import/no-dynamic-require
|
|
`exports ${ruleName}`,
|
|
);
|
|
});
|
|
|
|
t.end();
|
|
});
|
|
|
|
test('configurations', (t) => {
|
|
t.notEqual(plugin.configs.recommended, undefined, 'exports a \'recommended\' configuration');
|
|
|
|
t.end();
|
|
});
|
|
|
|
test('schemas', (t) => {
|
|
rules.forEach((ruleName) => {
|
|
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;
|
|
|
|
t.equal(type, 'object', `${ruleName} exports a schema with type object`);
|
|
});
|
|
|
|
t.end();
|
|
});
|