Open History to see the last commit
1import { describe, expect, it } from "vite-plus/test";
2
3import { classifyChangedFile } from "./changedFileKind.ts";
4
5describe("classifyChangedFile", () => {
6 it.each([
7 ["apps/server/src/ws.ts", "code"],
8 ["src/latest.ts", "code"],
9 ["src/Latest.java", "code"],
10 ["src/contest.py", "code"],
11 ["src/mockingbird.ts", "code"],
12 ["src/testimonials/List.tsx", "code"],
13 ["apps/web/src/foo.test.ts", "tests"],
14 ["apps/web/src/Foo.browser.test.tsx", "tests"],
15 ["src/foo.spec.js", "tests"],
16 ["pkg/server_test.go", "tests"],
17 ["tests/test_api.py", "tests"],
18 ["conftest.py", "tests"],
19 ["src/main/java/RequestTest.java", "tests"],
20 ["Sources/AppTests.swift", "tests"],
21 ["src/HTTPTest.java", "tests"],
22 ["Sources/URLTests.swift", "tests"],
23 ["spec/models/user_spec.rb", "tests"],
24 ["src/__tests__/helpers.ts", "tests"],
25 ["src/testUtils.ts", "code"],
26 ["src\\__tests__\\app.ts", "tests"],
27 ["src/__mocks__/fs.ts", "mocks"],
28 ["test/fixtures/pr.json", "mocks"],
29 ["src/__snapshots__/view.test.ts.snap", "mocks"],
30 ["src/api.mock.ts", "mocks"],
31 ["src/mockServer.ts", "mocks"],
32 ["pkg/testdata/input.txt", "mocks"],
33 ["pnpm-lock.yaml", "generated"],
34 ["apps/web/package-lock.json", "generated"],
35 ["go.sum", "generated"],
36 ["src/routeTree.gen.ts", "generated"],
37 ["src/__generated__/types.ts", "generated"],
38 ["dist/app.min.js", "generated"],
39 ["README.md", "docs"],
40 ["docs/internals/overview.mdx", "docs"],
41 ["NOTES.txt", "docs"],
42 ["requirements-dev.txt", "code"],
43 ["CMakeLists.txt", "code"],
44 ["tests/README.md", "tests"],
45 ] as const)("%s is %s", (path, kind) => {
46 expect(classifyChangedFile(path)).toBe(kind);
47 });
48});