Skip to content

Commit

Permalink
Add e2e test using real filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeharder committed Dec 20, 2024
1 parent 2563cd2 commit 6a555fb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 39 deletions.
17 changes: 17 additions & 0 deletions eng/tools/eslint-plugin-tsv/test/e2e-realfs.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { join, resolve } from "path";
import { describe, expect, it } from "vitest";
import { createESLint } from "./utils/e2e.js";

const specsFolder = resolve(__filename, "../../../../../specification");

describe("e2e-realfs", () => {
it("contosowidgetmanager/Contso.WidgetManager", async () => {
const eslint = createESLint();
const filePath = join(specsFolder, "contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml");
const results = await eslint.lintFiles(filePath);

expect(results).toHaveLength(1);
expect(results[0].filePath).toBe(filePath);
expect(results[0].messages).toHaveLength(0);
});
});

This file was deleted.

10 changes: 10 additions & 0 deletions eng/tools/eslint-plugin-tsv/test/utils/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ESLint } from "eslint";
import eslintPluginTsv from "../../src/eslint-plugin-tsv.js";

export function createESLint() {
return new ESLint({
cwd: "/",
overrideConfig: eslintPluginTsv.configs.recommended,
overrideConfigFile: true,
});
}

0 comments on commit 6a555fb

Please sign in to comment.