mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
build: fix action script
This commit is contained in:
parent
21be611abf
commit
fd283f544d
5
.github/scripts/check-tests.mjs
vendored
5
.github/scripts/check-tests.mjs
vendored
|
@ -48,7 +48,7 @@ const program = async () => {
|
||||||
.then(({stdout}) => stdout.trim().split('\n').filter(Boolean));
|
.then(({stdout}) => stdout.trim().split('\n').filter(Boolean));
|
||||||
|
|
||||||
// Get all .spec.ts and .test.ts files from the packages
|
// Get all .spec.ts and .test.ts files from the packages
|
||||||
const specAndTestTsFiles = await glob('../../packages/*/**/{test,__tests__}/*.{spec,test}.ts');
|
const specAndTestTsFiles = await glob('packages/*/**/{test,__tests__}/*.{spec,test}.ts');
|
||||||
const specAndTestTsFilesNames = specAndTestTsFiles.map(file => path.parse(file).name.replace(/\.(test|spec)/, ''));
|
const specAndTestTsFilesNames = specAndTestTsFiles.map(file => path.parse(file).name.replace(/\.(test|spec)/, ''));
|
||||||
|
|
||||||
// Filter out the .ts and .vue files from the changed files, .ts files with any kind of function declaration or class
|
// Filter out the .ts and .vue files from the changed files, .ts files with any kind of function declaration or class
|
||||||
|
@ -56,12 +56,11 @@ const program = async () => {
|
||||||
const changedTsFilesWithFunction = await filterAsync(
|
const changedTsFilesWithFunction = await filterAsync(
|
||||||
async filePath =>
|
async filePath =>
|
||||||
filePath.endsWith('.ts') &&
|
filePath.endsWith('.ts') &&
|
||||||
!(await glob('../../packages/*/**/{test,__tests__}/*.ts')).includes(filePath) &&
|
!(await glob('packages/*/**/{test,__tests__}/*.ts')).includes(filePath) &&
|
||||||
await hasFunctionOrClass(filePath),
|
await hasFunctionOrClass(filePath),
|
||||||
changedFiles
|
changedFiles
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// For each .ts or .vue file, check if there's a corresponding .test.ts or .spec.ts file in the repository
|
// For each .ts or .vue file, check if there's a corresponding .test.ts or .spec.ts file in the repository
|
||||||
changedVueFiles.concat(changedTsFilesWithFunction).forEach(async file => {
|
changedVueFiles.concat(changedTsFilesWithFunction).forEach(async file => {
|
||||||
const fileName = path.parse(file).name;
|
const fileName = path.parse(file).name;
|
||||||
|
|
Loading…
Reference in a new issue