From 1b889cd5a678f0ca7304d4f1280408503c7038e2 Mon Sep 17 00:00:00 2001 From: Csaba Tuncsik Date: Fri, 16 Jun 2023 11:05:51 +0200 Subject: [PATCH] build: ignore changed files in test folders --- .github/scripts/check-tests.mjs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/scripts/check-tests.mjs b/.github/scripts/check-tests.mjs index d5cf581eb5..9af692b237 100644 --- a/.github/scripts/check-tests.mjs +++ b/.github/scripts/check-tests.mjs @@ -53,7 +53,13 @@ const program = async () => { // Filter out the .ts and .vue files from the changed files, .ts files with any kind of function declaration or class const changedVueFiles = changedFiles.filter(file => file.endsWith('.vue')); - const changedTsFilesWithFunction = await filterAsync(async file => file.endsWith('.ts') && await hasFunctionOrClass(file), changedFiles); + const changedTsFilesWithFunction = await filterAsync( + async filePath => + filePath.endsWith('.ts') && + !(await glob('../../packages/*/**/{test,__tests__}/*.ts')).includes(filePath) && + await hasFunctionOrClass(filePath), + changedFiles + ); // For each .ts or .vue file, check if there's a corresponding .test.ts or .spec.ts file in the repository