From 451f66e1d8c4ec5f9f5f725f170887b24efdd4dc Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 3 Jun 2025 10:46:21 +0800 Subject: [PATCH] chore: avoid getIncludeFiles test deps on src folder structure --- tests/ts/test/utils/path.test.ts | 11 +++-------- tests/ts/test/utils/resources/a.resource | 0 tests/ts/test/utils/resources/b.resource | 0 3 files changed, 3 insertions(+), 8 deletions(-) create mode 100644 tests/ts/test/utils/resources/a.resource create mode 100644 tests/ts/test/utils/resources/b.resource diff --git a/tests/ts/test/utils/path.test.ts b/tests/ts/test/utils/path.test.ts index e2860bd..d4f5e39 100644 --- a/tests/ts/test/utils/path.test.ts +++ b/tests/ts/test/utils/path.test.ts @@ -28,13 +28,8 @@ test("findRoot", () => { }); test("getIncludeFiles", () => { - expect(getIncludeFiles(["src/core"], (s) => s.endsWith(".ts"))).toEqual([ - path.normalize("src/core/compile.ts"), - path.normalize("src/core/execute.ts"), - path.normalize("src/core/instrument.ts"), - path.normalize("src/core/precompile.ts"), - ]); - expect(getIncludeFiles(["tests/ts/fixture/transformFunction.ts"], (s) => s.endsWith(".ts"))).toEqual([ - path.normalize("tests/ts/fixture/transformFunction.ts"), + expect(getIncludeFiles(["tests/ts/test/utils/resources"], (s) => s.endsWith(".resource"))).toEqual([ + path.normalize("tests/ts/test/utils/resources/a.resource"), + path.normalize("tests/ts/test/utils/resources/b.resource"), ]); }); diff --git a/tests/ts/test/utils/resources/a.resource b/tests/ts/test/utils/resources/a.resource new file mode 100644 index 0000000..e69de29 diff --git a/tests/ts/test/utils/resources/b.resource b/tests/ts/test/utils/resources/b.resource new file mode 100644 index 0000000..e69de29