Skip to content

Commit 90fab86

Browse files
committed
Fix e2e tests
1 parent d7439da commit 90fab86

File tree

6 files changed

+52
-109
lines changed

6 files changed

+52
-109
lines changed

eng/tools/eslint-plugin-tsv/test/e2e-realfs.test.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { ESLint } from "eslint";
2+
import { join, resolve } from "path";
3+
import { describe, expect, it } from "vitest";
4+
import eslintPluginTsv from "../src/eslint-plugin-tsv.js";
5+
6+
function createESLint() {
7+
return new ESLint({
8+
cwd: "/",
9+
overrideConfig: eslintPluginTsv.configs.recommended,
10+
overrideConfigFile: true,
11+
});
12+
}
13+
14+
describe("lint-text", () => {
15+
it("Not-Kebab-Case/Not.KebabCase", async () => {
16+
const filePath = "/specification/Not-Kebab-Case/Not.KebabCase/tspconfig.yaml";
17+
const eslint = createESLint();
18+
19+
const results = await eslint.lintText("", { filePath: filePath });
20+
21+
expect(results).toHaveLength(1);
22+
expect(results[0].filePath).toBe(filePath);
23+
expect(results[0].messages[0].ruleId).toBe("tsv/kebab-case-org");
24+
});
25+
26+
it("Not-Kebab-Case-Disabled/Not.KebabCase", async () => {
27+
const filePath = "/specification/Not-Kebab-Case-Disabled/Not.KebabCase/tspconfig.yaml";
28+
const eslint = createESLint();
29+
30+
const results = await eslint.lintText("# eslint-disable tsv/kebab-case-org", {
31+
filePath: filePath,
32+
});
33+
34+
expect(results).toHaveLength(1);
35+
expect(results[0].filePath).toBe(filePath);
36+
expect(results[0].messages).toHaveLength(0);
37+
});
38+
});
39+
40+
describe("lint-files", () => {
41+
const specsFolder = resolve(__filename, "../../../../../specification");
42+
43+
it("contosowidgetmanager/Contso.WidgetManager", async () => {
44+
const eslint = createESLint();
45+
const filePath = join(specsFolder, "contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml");
46+
const results = await eslint.lintFiles(filePath);
47+
48+
expect(results).toHaveLength(1);
49+
expect(results[0].filePath).toBe(filePath);
50+
expect(results[0].messages).toHaveLength(0);
51+
});
52+
});

eng/tools/eslint-plugin-tsv/test/e2e/specification/Not-Kebab-Case-Disabled/Not.KebabCase/tspconfig.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

eng/tools/eslint-plugin-tsv/test/e2e/specification/Not-Kebab-Case/Not.KebabCase/tspconfig.yaml

Lines changed: 0 additions & 39 deletions
This file was deleted.

eng/tools/eslint-plugin-tsv/test/e2e/specification/eslint.config.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

eng/tools/eslint-plugin-tsv/test/utils/e2e.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)