mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-15 02:20:38 +09:00
Ignore test-only paths in dev restart tracking
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
eac3f3fa69
commit
75c7eb3868
3 changed files with 57 additions and 0 deletions
20
server/src/__tests__/dev-runner-paths.test.ts
Normal file
20
server/src/__tests__/dev-runner-paths.test.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { shouldTrackDevServerPath } from "../../../scripts/dev-runner-paths.mjs";
|
||||
|
||||
describe("shouldTrackDevServerPath", () => {
|
||||
it("ignores common test file paths", () => {
|
||||
expect(shouldTrackDevServerPath("server/src/__tests__/health.test.ts")).toBe(false);
|
||||
expect(shouldTrackDevServerPath("packages/shared/src/lib/foo.test.ts")).toBe(false);
|
||||
expect(shouldTrackDevServerPath("packages/shared/src/lib/foo.spec.tsx")).toBe(false);
|
||||
expect(shouldTrackDevServerPath("packages/shared/_tests/helpers.ts")).toBe(false);
|
||||
expect(shouldTrackDevServerPath("packages/shared/tests/helpers.ts")).toBe(false);
|
||||
expect(shouldTrackDevServerPath("packages/shared/test/helpers.ts")).toBe(false);
|
||||
expect(shouldTrackDevServerPath("vitest.config.ts")).toBe(false);
|
||||
});
|
||||
|
||||
it("keeps runtime paths restart-relevant", () => {
|
||||
expect(shouldTrackDevServerPath("server/src/routes/health.ts")).toBe(true);
|
||||
expect(shouldTrackDevServerPath("packages/shared/src/index.ts")).toBe(true);
|
||||
expect(shouldTrackDevServerPath("server/src/testing/runtime.ts")).toBe(true);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue