/
meta.ts
26 lines (24 loc) · 828 Bytes
/
meta.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import assert from "assert";
import plugin from "../../lib";
import { version } from "../../package.json";
const expectedMeta = {
name: "eslint-plugin-jsonc",
version,
};
describe("Test for meta object", () => {
it("A plugin should have a meta object.", () => {
assert.strictEqual(plugin.meta.name, expectedMeta.name);
assert.strictEqual(typeof plugin.meta.version, "string");
});
for (const [name, processor] of Object.entries(
// @ts-expect-error -- missing processors
plugin.processors || {}
)) {
it(`"${name}" processor should have a meta object.`, () => {
// @ts-expect-error -- missing type
assert.strictEqual(processor.meta.name, expectedMeta.name);
// @ts-expect-error -- missing type
assert.strictEqual(typeof processor.meta.version, "string");
});
}
});